how to run a command for batch file
Hi all
I am using a shell command for converting xml file format to gff file format
./interproscan.sh -mode convert -f gff3 -i input.xml -b output.gff
which converts an xml file to gff format. But the problem is I am able to run single sequence file at a time. And I have to work on hundred of sequences, which will take much time.
so I want to run this programme for a batch search at a time. how I can manage to do so. I know basic shell command but not able to run a command in loop.
• 3,751 views
•
link
1 answer
To run the command in a look and assuming you have no other xml files in your folder you could try:
for XML in *xml ; do basename $XML .xml | xargs -n 1 -P 1 -I {} sh -c "./interproscan.sh -mode convert -f gff3 -i {}.xml -b {}.gff" ; done
- Get all xml file names
- Get the file name without xml
- Use xargs to use the result of the basename command in the interproscan command
• 0 views
•
link
Log in to answer this question.
are the files catchable by a loop? i.e. have they got something/anything exclusively in common?
see Bash Loop For Job Submission , How To Run Muscle In Batch? , etc....