0
$\begingroup$

I have a total of 78 ATAC seq samples from which Im trying to do a peak call .I tried this batchParallel.pl findPeaks peaks function but i couldn't find the output what it makes.

So I tried using loop but again the peak file is not written due to incorrect argument usage I guess.

These are my sample directories where i have all the tags

SRR2920564  SRR2920565

I used homer to make tag directories and now i using it for peakcalling.

here is my command.

for d in */ ; do findPeaks $d -style factor -o "${d}.txt" ; done 

What i need is all the peakfile should be written as the directory name.

Such as if directory is "SRR2920564" then my peak file should be written in the same directory as SRR2920564.txt

I do run the loop it runs successfully but no output written. May be a mundane mistake am not able to figure it out.

Any suggestion or help would be highly appreciated .

$\endgroup$
2
  • $\begingroup$ Your output file is a bit weird. findPeaks directoryname/ -style factor -o directoryname/.txt You would be attempting to create a file called ".txt" inside each directory? (Also do you need those quotes). Did you try running this with "-o auto" and checking in each directory if the corresponding files (i.e peaks.txt, regions.txt, transcripts.txt, etc..) were generated? $\endgroup$
    – story
    Nov 12 '19 at 10:36
  • $\begingroup$ I tried running auto it gives an output peak.txt but when it would be easy if i can name them as the directory name for as unique name for each file $\endgroup$
    – kcm
    Nov 12 '19 at 14:42
1
$\begingroup$

You just need to strip the / from $d, for which there are a number of options:

for d in */ ; do 
    dname=`basename $d`
    findPeaks $d -style factor -o ${dname}.txt
done

or

for d in */ ; do
    dname=${d%%/}
    findPeaks $d -style factor -o ${dname}.txt
done

There are likely other ways one could go about this. Having said that, since you're not running these in parallel you could simply move the default output file (peak.txt) to a file name of your choice (using one of the strategies above).

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.