~ubuntu-branches/ubuntu/wily/trimmomatic/wily-proposed

« back to all changes in this revision

Viewing changes to src/org/usadellab/trimmomatic/trim/LeadingTrimmer.java

  • Committer: Package Import Robot
  • Author(s): Andreas Tille, Olivier Sallou
  • Date: 2013-08-07 12:14:33 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20130807121433-qxchmfrrodridtvz
Tags: 0.30+dfsg-1
* New upstream version
* debian/copyright:
   - DEP5
   - Add Files-Excluded to document what was removed from original source
* debian/watch: handle +dfsg suffix
* debian/get-orig-source: use new uscan if available
* debian/control:
   - cme fix dpkg-control
   - debhelper 9
   - use anonscm in Vcs fields
   - Build-Depends: default-jdk | ...
     Closes: #718850
[ Olivier Sallou]
    * Manage java libs with javahelper
    * Provide upstream missing MANIFEST.MF

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package org.usadellab.trimmomatic.trim;
 
2
 
 
3
import org.usadellab.trimmomatic.fastq.FastqRecord;
 
4
 
 
5
public class LeadingTrimmer extends AbstractSingleRecordTrimmer
 
6
{
 
7
    private int qual;
 
8
 
 
9
    public LeadingTrimmer(String args)
 
10
    {
 
11
            qual=Integer.parseInt(args);
 
12
    }
 
13
 
 
14
    public LeadingTrimmer(int qual) {
 
15
        this.qual = qual;
 
16
    }
 
17
        
 
18
        
 
19
 
 
20
    @Override
 
21
    public FastqRecord processRecord(FastqRecord in)
 
22
    {
 
23
            String seq=in.getSequence();
 
24
            int quals[]=in.getQualityAsInteger(true);
 
25
 
 
26
            for(int i=0;i<seq.length();i++)
 
27
                    {
 
28
                    if(quals[i]>=qual)
 
29
                            return new FastqRecord(in,i,seq.length()-i);
 
30
                    }
 
31
 
 
32
            return null;
 
33
    }
 
34
 
 
35
}