text: user285: 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 .
  
  user77: 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).
  
original_text: 285: <p>I have a total of 78 ATAC seq samples from which Im trying to do a peak call .I tried this <code>batchParallel.pl findPeaks peaks</code> function but i couldn't find the output what it makes.</p>
  
  <p>So I tried using loop but again the peak file is not written due to incorrect argument usage I guess.</p>
  
  <p>These are my sample directories where i have all the tags</p>
  
  <pre><code>SRR2920564  SRR2920565
  </code></pre>
  
  <p>I used homer to make tag directories and now i using it for peakcalling.</p>
  
  <p>here is my command.</p>
  
  <pre><code>for d in */ ; do findPeaks <span class="math-container">$d -style factor -o "$</span>{d}.txt" ; done 
  </code></pre>
  
  <p>What i need is all the peakfile should be written as the directory name.</p>
  
  <p>Such as if directory is "<code>SRR2920564</code>" then my peak file should be written in the same directory as <code>SRR2920564.txt</code></p>
  
  <p>I do run the loop it runs successfully but no output written. May be a mundane mistake am not able to figure it out.</p>
  
  <p>Any suggestion or help would be highly appreciated .</p>
   77: <p>You just need to strip the <code>/</code> from <code>$d</code>, for which there are a number of options:</p>
  
  <pre><code>for d in */ ; do 
      dname=`basename $d`
      findPeaks <span class="math-container">$d -style factor -o $</span>{dname}.txt
  done
  </code></pre>
  
  <p>or</p>
  
  <pre><code>for d in */ ; do
      dname=<span class="math-container">${d%%/}
      findPeaks $</span>d -style factor -o ${dname}.txt
  done
  </code></pre>
  
  <p>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 (<code>peak.txt</code>) to a file name of your choice (using one of the strategies above).</p>
  