Question: error in sed usage
0
gravatar for evafinegan
7 weeks ago by
evafinegan0
evafinegan0 wrote:

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 • 135 views
ADD COMMENTlink modified 7 weeks ago • written 7 weeks ago by evafinegan0

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

ADD REPLYlink written 7 weeks ago by JC12k

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

ADD REPLYlink written 7 weeks ago by evafinegan0

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 REPLYlink written 7 weeks ago by JC12k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 948 users visited in the last hour