keep the variants ID after filteration
1
0
Entering edit mode
8.4 years ago

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 next-gen sequence alignment • 2.2k views
ADD COMMENT
1
Entering edit mode
8.3 years ago
dschika ▴ 320

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 COMMENT
0
Entering edit mode

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

ADD REPLY
1
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
1
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
1
Entering edit mode

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 REPLY
1
Entering edit mode

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

ADD REPLY

Login before adding your answer.

Traffic: 2683 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6