Examples of nextSequence()


Examples of htsjdk.samtools.reference.ReferenceSequenceFile.nextSequence()

*/
public class CreateBWTFromReference {
    private byte[] loadReference( File inputFile ) {
        // Read in the first sequence in the input file
        ReferenceSequenceFile reference = ReferenceSequenceFileFactory.getReferenceSequenceFile(inputFile);
        ReferenceSequence sequence = reference.nextSequence();
        return sequence.getBases();
    }

    private byte[] loadReverseReference( File inputFile ) {
        ReferenceSequenceFile reference = ReferenceSequenceFileFactory.getReferenceSequenceFile(inputFile);
View Full Code Here

Examples of htsjdk.samtools.reference.ReferenceSequenceFile.nextSequence()

        return sequence.getBases();
    }

    private byte[] loadReverseReference( File inputFile ) {
        ReferenceSequenceFile reference = ReferenceSequenceFileFactory.getReferenceSequenceFile(inputFile);
        ReferenceSequence sequence = reference.nextSequence();
        PackUtils.reverse(sequence.getBases());
        return sequence.getBases();
    }

    private Counts countOccurrences( byte[] sequence ) {
View Full Code Here

Examples of htsjdk.samtools.reference.ReferenceSequenceFile.nextSequence()

        // Read in the first sequence in the input file
        String inputFileName = argv[0];
        File inputFile = new File(inputFileName);
        ReferenceSequenceFile reference = ReferenceSequenceFileFactory.getReferenceSequenceFile(inputFile);
        ReferenceSequence sequence = reference.nextSequence();

        // Target file for output
        PackUtils.writeReferenceSequence( new File(argv[1]), sequence.getBases() );

        // Reverse the bases in the reference
View Full Code Here

Examples of htsjdk.samtools.reference.ReferenceSequenceFile.nextSequence()

        if (clipSequenceFile != null) {
            ReferenceSequenceFile rsf = ReferenceSequenceFileFactory.getReferenceSequenceFile(new File(clipSequenceFile));

            while (true) {
                ReferenceSequence rs = rsf.nextSequence();
                if (rs == null)
                    break;
                else {
                    addSeqToClip(rs.getName(), rs.getBases());
                }
View Full Code Here

Examples of htsjdk.samtools.reference.ReferenceSequenceFile.nextSequence()

        // Loop over the reference and the reads and calculate the basic metrics
        ////////////////////////////////////////////////////////////////////////////
        ReferenceSequence ref = null;
        final ProgressLogger
                progress = new ProgressLogger(log);
        while ((ref = referenceFile.nextSequence()) != null) {
            final byte[] refBases = ref.getBases();
            StringUtil.toUpperCase(refBases);
            final int refLength = refBases.length;
            final int lastWindowStart = refLength - WINDOW_SIZE;
View Full Code Here

Examples of htsjdk.samtools.reference.ReferenceSequenceFile.nextSequence()

        final ReferenceSequenceFile refSeqFile =
                ReferenceSequenceFileFactory.getReferenceSequenceFile(referenceFile, TRUNCATE_NAMES_AT_WHITESPACE);
        ReferenceSequence refSeq;
        final List<SAMSequenceRecord> ret = new ArrayList<SAMSequenceRecord>();
        final Set<String> sequenceNames = new HashSet<String>();
        for (int numSequences = 0; numSequences < NUM_SEQUENCES && (refSeq = refSeqFile.nextSequence()) != null; ++numSequences) {
            if (sequenceNames.contains(refSeq.getName())) {
                throw new PicardException("Sequence name appears more than once in reference: " + refSeq.getName());
            }
            sequenceNames.add(refSeq.getName());
            ret.add(makeSequenceRecord(refSeq));
View Full Code Here

Examples of htsjdk.samtools.reference.ReferenceSequenceFile.nextSequence()

        final ReferenceSequenceFile ref = ReferenceSequenceFileFactory.getReferenceSequenceFile(INPUT, TRUNCATE_SEQUENCE_NAMES_AT_WHITESPACE);
        final BufferedWriter out = IOUtil.openFileForBufferedWriting(OUTPUT);

        ReferenceSequence seq = null;
        while ((seq = ref.nextSequence()) != null) {
            final String name  = seq.getName();
            final byte[] bases = seq.getBases();

            try {
                out.write(">");
View Full Code Here

Examples of net.sf.picard.reference.ReferenceSequenceFile.nextSequence()

    final Map<SNPCallPair, TreeMap<Integer, Long>> calltable_validation = new HashMap<SNPCallPair, TreeMap<Integer, Long>>();

    ReferenceSequence reference = null;

    while ((reference = reference_file.nextSequence()) != null) {
      for (SamPositionIterator position_iterator : positionIterators) {
        position_iterator.nextSequence();
        String ref_name = reference.getName();

        if (!position_iterator.getCurrentSequence().equals(ref_name))
View Full Code Here

Examples of org.jquantlib.math.randomnumbers.SobolRsg.nextSequence()

        final SobolRsg rsg = new SobolRsg(5, seed);

        final double tolerance = 1.7e-4;
        // actually tested up to 2^21-1=2097151 Sobol draws
        for (int i = 0; i < 1023; ++i) {
            final double next[] = rsg.nextSequence().value();
// TODO: translate properly
//            s = grid[0].front() + next[0]*(grid[0].back()-grid[0].front());
//            t = grid[1].front() + next[1]*(grid[1].back()-grid[1].front());
//            u = grid[2].front() + next[2]*(grid[2].back()-grid[2].front());
//            v = grid[3].front() + next[3]*(grid[3].back()-grid[3].front());
 
View Full Code Here

Examples of org.jquantlib.math.randomnumbers.SobolRsg.nextSequence()

        final SobolRsg rsg = new SobolRsg(5, seed);

        final double tolerance = 1.7e-4;
        // actually tested up to 2^21-1=2097151 Sobol draws
        for (int i = 0; i < 1023; ++i) {
            final double next[] = rsg.nextSequence().value();
// TODO: translate properly
//            s = grid[0].front() + next[0]*(grid[0].back()-grid[0].front());
//            t = grid[1].front() + next[1]*(grid[1].back()-grid[1].front());
//            u = grid[2].front() + next[2]*(grid[2].back()-grid[2].front());
//            v = grid[3].front() + next[3]*(grid[3].back()-grid[3].front());
 
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.