Examples of Aligner


Examples of net.sourceforge.align.filter.aligner.Aligner

    SplitAlgorithm splitAlgorithm = new SplitAlgorithmMock(1);
    AlignAlgorithm alignAlgorithm = new AlignAlgorithmMock(2);
    MergeAlgorithm mergeAlgorithm = new SeparatorMergeAlgorithm();
    List<Filter> filterList = new ArrayList<Filter>();
    filterList.add(new Modifier(splitAlgorithm, splitAlgorithm));
    filterList.add(new Aligner(alignAlgorithm));
    filterList.add(new Modifier(mergeAlgorithm, mergeAlgorithm));
    CompositeFilter composite = new CompositeFilter(filterList);
    List<Alignment> alignmentList = createAlignmentList(
        SOURCE_SEGMENT_ARRAY, TARGET_SEGMENT_ARRAY);
    List<Alignment> resultAlignmentList = composite.apply(alignmentList);
View Full Code Here

Examples of net.sourceforge.align.filter.aligner.Aligner

   * Tests whether alignments with infinite score are ignored and
   * the ones without are not by using {@link OneToOneAlgorithm} aligner.
   */
  @Test
  public void testIgnoreInfiniteProbability() {
    Filter oneToOneAligner = new Aligner(new OneToOneAlgorithm());
    Filter filter =
      new IgnoreInfiniteProbabilityAlignmentsFilterDecorator(oneToOneAligner);

    List<Alignment> alignmentList = createAlignmentList(
        SOURCE_SEGMENT_ARRAY, TARGET_SEGMENT_ARRAY);
View Full Code Here

Examples of net.sourceforge.align.filter.aligner.Aligner

        loadAlignmentList(unificationCorpus);
      filter = new UnifyAligner(unificationAlignmentList);
    } else {
      alignmentList = parser.parse();
      AlignAlgorithm algorithm = createAlgorithm(commandLine, alignmentList);
      filter = new Aligner(algorithm);
    }
    filter = FilterDecorators.decorate(filter);
    Formatter formatter = new AlFormatter(getOut());
    if (alignmentList == null) {
      alignmentList = parser.parse();
View Full Code Here

Examples of org.broadinstitute.gatk.engine.alignment.Aligner

        align(referenceFile,bwtFile,rbwtFile,suffixArrayFile,reverseSuffixArrayFile,bamFile);
    }

    private static void align(File referenceFile, File bwtFile, File rbwtFile, File suffixArrayFile, File reverseSuffixArrayFile, File bamFile) throws FileNotFoundException {
        Aligner aligner = new BWAJavaAligner(bwtFile,rbwtFile,suffixArrayFile,reverseSuffixArrayFile);
        int count = 0;

        SAMFileReader reader = new SAMFileReader(bamFile);
        reader.setValidationStringency(ValidationStringency.SILENT);

        int mismatches = 0;
        int failures = 0;

        for(SAMRecord read: reader) {
            count++;
            if( count > 200000 ) break;
            //if( count < 366000 ) continue;
            //if( count > 2 ) break;
            //if( !read.getReadName().endsWith("SL-XBC:1:82:506:404#0") )
            //    continue;
            //if( !read.getReadName().endsWith("SL-XBC:1:36:30:1926#0") )
            //    continue;
            //if( !read.getReadName().endsWith("SL-XBC:1:60:1342:1340#0") )
            //    continue;

            SAMRecord alignmentCleaned = null;
            try {
                alignmentCleaned = (SAMRecord)read.clone();
            }
            catch( CloneNotSupportedException ex ) {
                throw new ReviewedGATKException("SAMRecord clone not supported", ex);
            }

            if( alignmentCleaned.getReadNegativeStrandFlag() )
                alignmentCleaned.setReadBases(BaseUtils.simpleReverseComplement(alignmentCleaned.getReadBases()));

            alignmentCleaned.setReferenceIndex(SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX);
            alignmentCleaned.setAlignmentStart(SAMRecord.NO_ALIGNMENT_START);
            alignmentCleaned.setMappingQuality(SAMRecord.NO_MAPPING_QUALITY);
            alignmentCleaned.setCigarString(SAMRecord.NO_ALIGNMENT_CIGAR);

            // Clear everything except flags pertaining to pairing and set 'unmapped' status to true.
            alignmentCleaned.setFlags(alignmentCleaned.getFlags() & 0x00A1 | 0x000C);

            Iterable<Alignment[]> alignments = aligner.getAllAlignments(alignmentCleaned.getReadBases());
            if(!alignments.iterator().hasNext() ) {
                //throw new GATKException(String.format("Unable to align read %s to reference; count = %d",read.getReadName(),count));
                System.out.printf("Unable to align read %s to reference; count = %d%n",read.getReadName(),count);
                failures++;
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.