error in sed usage
0
0
Entering edit mode
4.0 years ago
evafinegan • 0

Hello,

I am using this loop for a software"

RUN=$(printf "%02d" ${SLURM_ARRAY})
INPUT_DIR=/path
OUTPUT_DIR=/path
echo "RUN"
INPUT_FILE=$(ls $INPUT_DIR/*.bed | sed -n ${RUN}p)
SAMPLE=$(basename "$INPUT_FILE" .bed)
echo "RUN #${RUN} with sample ${SAMPLE}"
freebayes -f genome.fasta  \
          -L genome_1.txt \
          --targets ${INPUT_FILE}  > ${OUTPUT_DIR}/${SAMPLE}_.vcf

But I am getting error:

sed: -e expression #1, char 3: invalid usage of line address 0

Thank you for the help.

sequencing • 1.0k views
ADD COMMENT
0
Entering edit mode

what are you trying to do with sed? or what is the expected value of INPUT_FILE?

ADD REPLY
0
Entering edit mode

INPUT_FILE is expected to give each of the bed file name along with path to run with an array.

ADD REPLY
0
Entering edit mode

I am not sure if freebayes --targets accepts more than one file, but in case you will need to put together in a single string, like:

INPUT_FILE=$(ls $INPUT_DIR/*.bed | perl -pe "s/\n/,/g")
ADD REPLY

Login before adding your answer.

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