This is a test version of Biostars. For the public version, visit https://www.biostars.org.
loop for samtools to deal with multiple files

Hello,

I have a script to run samtools pileup for multiple files. The script worked if I ran one file at a time without loop, but it gave me error saying "Illegal variable name" with the loop. So, I think it is something wrong with the loop. I have to use the old version of samtools with the pileup for the downstream analysis. Please anyone help me out with the issue.

#! /bin/csh

cd /share/gwascotton/GBS_data/pileup_trial/ source /usr/local/apps/samtools/samtools017a.csh for i in $(ls *.bam);do samtools pileup -c -l /share/gwascotton/GBS_data/merged_files.sorted.bam.pileup -f /share/gwascotton/GBS_data/Ghirsutum_458_v1.0.fa /share/gwascotton/GBS_data/pileup_trial/"$i" > /share/gwascotton/GBS_data/new/"$i".pileup done ;

Thank you.

fhzh

snp software error

Hello hfang4!

Questions similar to yours can already be found at:

We have closed your question to allow us to keep similar content in the same thread.

If you disagree with this please tell us why in a reply below. We'll be happy to talk about it.

Cheers!

0 answers

No answers yet.

Log in to answer this question.