Hi everyone! I have a problem with my bash code, which I added down here. I would like to automatize the my RNA-seq workflow and I tried to write this bash code. (I am pretty new in bash and programming.) I expect several steps from my code. These are;
changing the directory into source directory and give me a notification. (It works fine)
creating a file array with finding all files that is named as accepted_hits.bam in source directory and its sub-folder.(Problem occurs here. My code scans all computer and i have a memory error.)
and run featureCounts.
echo 'Going to $SOURCE_DIR'
for file in $FILE_ARRAY; do
echo "Working on $serial_number"
mkdir -p $TARGET_DIR/$serial_number
featureCounts -t $SOURCE_DIR/$file -a /home/cilga/Desktop/VPC/ref/hg19/hg19.gtf -o $TARGET_DIR$serial_number done
Hello everyone, I was able to solve problem with small touches. I am sharing my working code :) Thanks for everyone for your helps.
Just shows the files, literally does nothing else
| xargs echopart does nothing here
Shows the path and literally does nothing else
Also, you should always quote your Bash variables..
hi. thank you, for your explanations. I am pretty new in bash and also programming too. I tried to combine things together :( thank you again!