dpuiu / MitoHPC

MIT License
10 stars 12 forks source link

Analyze bams under subdirectly #7

Open FL512 opened 1 year ago

FL512 commented 1 year ago

Hi Daniela,

Thank you for sharing MitoHPC for us. I believe this tool should move my project forward. One thing that I wanted to ask you today is that how can I run with the input bam files that are located in the subdirectly? There is no problem at all running with your test bam files and my bam files of interest if I put them under one directly. However, as you may know, the file size of each bam is too big to copy or move, therefore, I tried to read each bam from the original subdirectly but did not work well so far. I think the code I should modify is from line 119 to line 129 of init.sh, typically line 127. Below is the original init.sh from 119 to 129 for your information.

PWD=pwd -P` export HP_FDIR=$PWD/fastq/ # fastq input file directory ; .fq or .fq.gz file extension export HP_ADIR=$PWD/bams/ # bams or crams input file directory export HP_ODIR=$PWD/out/ # output dir export HP_IN=$PWD/in.txt # input file to be generated

if [ -d $HP_ADIR ] ; then if [ ! -s $HP_IN ] ; then find $HP_ADIR/ -name ".bam" -o -name ".cram" -readable | ls2in.pl -out $HP_ODIR | sort -V > $HP_IN fi fi`

I have modified above code by using -type, -exec or even . for my purpose but no luck (I am not so good at shell script). Will you please give me suggestions or feedback regarding the issue I have encountered, please?

Best regards, Ken

P.S. Because the original script have ` in there (PWD =pwd -P`), I could not insert the code here properly. I am sorry for any inconvenience caused.

FL512 commented 1 year ago

Hi, although it was not a perfect way, I figured out by myself. Thank you!

dpuiu commented 1 year ago

Hi Ken, I am glad it worked! Other options would be to create symlinks to the input files and have them all under $HP_ADIR , or generate a custom $HP_IN input file.

FL512 commented 1 year ago

Thank you Daniela, I do keep in mind and will give it a try later! K