Hi All,
I have a table with six columns (in the following).
So, I want to delete SNPs that are less than number 10 in the SNP column.
What is the best idea?
Best Regard
Mostafa
Hi All,
I have a table with six columns (in the following).
So, I want to delete SNPs that are less than number 10 in the SNP column.
What is the best idea?
Best Regard
Mostafa
awk !
a cmdline such as below one should do the trick:
awk ' $4 >= 10' <table-file> > new_file
and if you want to (additionally) apply calculations on a certain column:
awk ' $4 >= 10' <table-file> | awk '$2=$2+2000' > new_file
Read the file, and filter out any row where SNP column is more than or equal to 10:
data <- read.table("SNP.txt", header = TRUE)
data <- data[ data$SNP >= 10, ])
To exclude 1st BP column, and to add 20KB to BP column:
data <- data[ , -3 ]
data$BP <- data$BP + 20000
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
You can filter out these rows :
https://stackoverflow.com/questions/7381455/filtering-a-data-frame-by-values-in-a-column