Question: keep the variants ID after filteration
0
gravatar for rastogi.suraj93
2.8 years ago by
rastogi.suraj9330 wrote:

Hello everyone, I would like to appreciate if some one help me. I tried to make SNPs ID in VCF file REplace to 0 but facing some problem which occur by commands. my commands is
/SnpEff cat variants.vcf | java -jar SnpSift.jar filter --set my_rs.txt "ID in SET[0]" > filtered.vcf and after getting error like - Exception in thread "main" java.lang.RuntimeException: File not found 'my_rs.txt' so please some one help me where I have to make the mistake for accessing this command ? Thanking you all

snp sequence next-gen alignment • 846 views
ADD COMMENTlink modified 2.8 years ago by dschika290 • written 2.8 years ago by rastogi.suraj9330
1
gravatar for dschika
2.8 years ago by
dschika290
European Union
dschika290 wrote:

Look at the error message:

Exception in thread "main" java.lang.RuntimeException: File not found 'my_rs.txt

The file my_rs.txt is missing

ADD COMMENTlink written 2.8 years ago by dschika290

yeah..so please suggest me any other tools and command

ADD REPLYlink written 2.8 years ago by rastogi.suraj9330
1

From the SnpSift manual:

I want to keep samples where the ID matches a set defined in a file: cat variants.vcf | java -jar SnpSift.jar filter --set my_rs.txt "ID in SET[0]" > filtered.vcf and the file my_rs.txt has one string per line, e.g.:

rs58108140

rs71262674

rs71262673

I don't use SnpSift, but it seems not too complicated: Generate a file called my_rs.txt with one SNP id per line. Do you have that file?

ADD REPLYlink modified 2.8 years ago • written 2.8 years ago by dschika290

No I dont have. I have vcf file without SNP ID like -

CHROM POS ID REF ALT QUAL

NC_00839 536376 0 TAGCTAGCT TAGCTAGCTAAGCTAGCT 96.5

ADD REPLYlink modified 2.8 years ago • written 2.8 years ago by rastogi.suraj9330
1

Well, you wrote

I tried to make SNPs ID in VCF file REplace to 0

Do you have SNP IDs for your SNPs? Do you have a file with 'chromosome position SNP-id'? If you don't have something like this: With what do you want to replace the SNP id??

ADD REPLYlink written 2.8 years ago by dschika290

yeah, in my snp file have chr position but SNP ID is not mention. at the column of ID is mention only 0. I want also give SNP ID in my file like
rs58108140

rs71262674

rs71262673 so how can I give to SNP ID in my vcf file?

ADD REPLYlink written 2.8 years ago by rastogi.suraj9330
1

Afaik there is 'no automatic SNP id naming tool'.

You could make a SNP-id e.g., consisting of chromosome name and position:

awk '{if ( $1 ~ /^#/ ) {print $0} else {$3 = $1"_"$2; print $0}}' YOUR.vcf > NEW.vcf

ADD REPLYlink written 2.8 years ago by dschika290
1

Ok, thank you so much. I will try like this.

ADD REPLYlink written 2.8 years ago by rastogi.suraj9330
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 651 users visited in the last hour