Entering edit mode
3.8 years ago
r00628112
▴
10
Good afternoon everyone:
I saved the script for each sam file in a A.txt file as below:
java -jar /data/share/tools/gatk-4.1.7.0/gatk-package-4.1.7.0-local.jar SortSam -I DRR212437.sam -O DRR212437.sort.bam -SO coordinate --CREATE_INDEX TRUE
java -jar /data/share/tools/gatk-4.1.7.0/gatk-package-4.1.7.0-local.jar SortSam -I DRR212438.sam -O DRR212438.sort.bam -SO coordinate --CREATE_INDEX TRUE
java -jar /data/share/tools/gatk-4.1.7.0/gatk-package-4.1.7.0-local.jar SortSam -I DRR212439.sam -O DRR212439.sort.bam -SO coordinate --CREATE_INDEX TRUE
then I ran this shell command but failed:
sh A.txt
When I copy each command to run, it can run as usual. What's the reason?
Because I used the same way to ran "bwa mem" command for each .fq file that is no this problem, I can get each sam file successfully.
Thank you very much
That's not a script, it doesn't even have a shebang. This could work thou:
cat A.txt | sh
You said
sh A.txt
failed, can you post error message?Just show the gatk basic usage information, I think there must be something wrong in the comment.
This is not a Shell script. Do like this:
Just save this as .sh file and run
bash file.sh
I would suggest using a
for loop
into the script so you can iterate over all samples!Thank you so much.
I really need automatic command for running all samples.
Is it correct loop?