Entering edit mode
4.3 years ago
Seigfried
▴
80
Hello!
I have a reference file
x.vcf.gz
I also have multiple query files say
1y.vcf.gz
2y.vcf.gz
3y.vcf.gz
.... 603y.vcf.gz
I want to intersect the reference with each separate query file.
Since I have the query files all in one folder, I did
for i in *.vcf.gz; do bcftools isec $i /mnt/projects/x.vcf.gz -p $i -n =2 -w 1; done
This generated multiple folders called 1y.vcf.gz 2y.vcf.gz 3y.vcf.gz
.
If I don't specify -p it will just overwrite the files.
Each of these folders contain files with the same name.
Is there any way to simply just rename the files with a prefix and not create multiple folders?
Thank you @genomax for the edits. I need to specify there is an option
-o $i.vcf
. This gives me one of the output files and if i specify -p i get 3 outputs. Thank you.Can you not create separate folders for each query and then send the output to that folder in your for loop? Following is NOT a solution just an idea for you to think about.