Entering edit mode
4.1 years ago
newbie
▴
130
Hi,
I have 120 sorted.bam
files. I would like to check the strandedness of each sample. Whether unstranded or stranded. All 120 sorted.bams are in this directory /data/bams
For that, I kept all the sample names in the samples.txt
file. And I started using a shell sbatch
script like below:
#!/bin/bash
#SBATCH --job-name=strandspecify_Job
#SBATCH --cpus-per-task=8
#SBATCH --mem-per-cpu=1G
#SBATCH --time=0:30:00
#SBATCH --qos=30min
#SBATCH --output=outputs/Inferstrand_%j_%a.out # Standard output
#SBATCH --error=outputs/Inferstrand_%j_%a.err # Standard error
#SBATCH --array=1-120%5
LBID=$(head -$SLURM_ARRAY_TASK_ID /data/samples.txt | tail -1)
Path=/data/bams
ml load RSeQC/2.6.4-goolf-1.7.20-Python-2.7.11-R-3.2.4
python infer_experiment.py -r gencode.v27.annotation.bed -i $Path/${LBID}.sorted.bam
All the Standard output files have information only about a Fraction of reads like below:
Fraction of reads failed to determine: 0.0658
Fraction of reads explained by "1++,1--,2+-,2-+": 0.4677
Fraction of reads explained by "1+-,1-+,2++,2--": 0.4665
But nowhere it is mentioned the output is from which samples? Is there a way to write all the outputs into one file with the sample name in it to know which output is from which sample?
Why don't you add:
Just before the call to
infer_experiment.py
?Why not using a
for
loop to call each bam file? You could get the filename into a variable and you could echo first thefilename
than theoutput
Can you please show me how to do that?
add an
echo
before calling your python code:Thanks a lot...it looks fine now.