how to run a command for batch file
1
0
Entering edit mode
6.4 years ago

Hii all

Actually 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 convert a xml file to gff format. but problem is i am able to run single sequence file at a time. And i have to work on hundred of sequnece, 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.

 

coomand unix linux shell • 2.5k views
ADD COMMENT
0
Entering edit mode

are the files catchable by a loop? i.e. have they got something/anything exclusively in common?

ADD REPLY
0
Entering edit mode
ADD REPLY
0
Entering edit mode
6.4 years ago
dschika ▴ 310

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
ADD COMMENT

Login before adding your answer.

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