Gene based data extraction from finally annotated VCF file
1
0
Entering edit mode
20 months ago
t.ali • 0

Hi there, I have annotated .vcf and .txt file as a result of variant calling pipeline for whole exome sequencing. Now I want to extract almost 50 genes data from these files, either .vcf or .txt.

I used grep command with for loop but it is also extracting the other genes data as well. For example if I want to see only CCL2, grep command is extracting CCL20, CCL28 and so on as well.

i used the following command:

for GENE in `cat Genelist`;
do
grep -i  "${GENE}"  /Final_annotated_files/1st-Priority/file_name.txt > /Final_annotated_files/1st-Priority/file_output-${GENE}.csv
done

If I used -x instead of -i, loop don't work.

Please help me with the any command which I can used in loops because I have many samples and from each sample I need to extract almost 100 gene's data.

Thanks

vcf filtration annotation • 731 views
ADD COMMENT
0
Entering edit mode
20 months ago
grep -F -w '${GENE}' in.txt
ADD COMMENT
0
Entering edit mode

I tried this, but again its now writing any information in the file.

ADD REPLY
0
Entering edit mode

show us such line+keyword.

Also, check there is no empty line in your Genelist.

ADD REPLY
0
Entering edit mode

for GENE in cat Genelist; #to get the name from gene list do grep -i "${GENE}" input_file_name.txt > file_output-${GENE}.csv # checking the .txt file for the gene name and extracting data into new file done

ADD REPLY

Login before adding your answer.

Traffic: 2906 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