Reputation: 1
Here is my code in shell and I include python command:
for file in `ls $FOLDER`
do
echo "$file"
var=`python -c "from Bio import SeqIO, SeqUtils; import os; rec = SeqIO.read("**$FOLDER/$file**", 'fasta'); SeqUtils.xGC_skew(rec.seq, 220000)" `
done
And I do not know how to make python recognize my file name
Upvotes: 0
Views: 49
Reputation: 246744
I see some common shell mistakes:
ls
. Use
for file in "$FOLDER"/*; ...
$(...)
instead of `...`
-- easier to read, easier to nest. ReferencePATH=something
and then wonder why your script is broken.Upvotes: 0
Reputation: 1299
You need to escape the double quotes in the python code:
for file in `ls $FOLDER`
do
echo "$file"
var=`python -c "from Bio import SeqIO, SeqUtils; import os; rec = SeqIO.read(\"$FOLDER/$file\", 'fasta'); SeqUtils.xGC_skew(rec.seq, 220000)" `
done
Upvotes: 1