当前位置: 首页>>代码示例>>Java>>正文


Java AsciiLineReader.readLine方法代码示例

本文整理汇总了Java中htsjdk.tribble.readers.AsciiLineReader.readLine方法的典型用法代码示例。如果您正苦于以下问题:Java AsciiLineReader.readLine方法的具体用法?Java AsciiLineReader.readLine怎么用?Java AsciiLineReader.readLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在htsjdk.tribble.readers.AsciiLineReader的用法示例。


在下文中一共展示了AsciiLineReader.readLine方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: writeHeader

import htsjdk.tribble.readers.AsciiLineReader; //导入方法依赖的package包/类
@Override
String writeHeader(AsciiLineReader reader, PrintWriter writer) {
    String nextLine;

    try {
        nextLine = reader.readLine();
        while (nextLine.startsWith("#")) {
            writer.println(nextLine);
            nextLine = reader.readLine();
        }
    } catch (IOException e) {
        throw new RuntimeIOException(e);
    }

    return nextLine;
}
 
开发者ID:react-dev26,项目名称:NGB-master,代码行数:17,代码来源:GFFSorter.java

示例2: writeHeader

import htsjdk.tribble.readers.AsciiLineReader; //导入方法依赖的package包/类
@Override
String writeHeader(AsciiLineReader reader, PrintWriter writer) throws IOException {

    String nextLine = reader.readLine();

    if (nextLine.startsWith("psLayout")) {
        do {
            writer.println(nextLine);
            nextLine = reader.readLine();
        } while (!nextLine.startsWith("-"));
        nextLine = reader.readLine();
    }
    while (nextLine.startsWith("#") ||
            nextLine.startsWith("browser") ||
            nextLine.startsWith("track") ||
            isEmptyLine(nextLine)) {
        writer.println(nextLine);
        nextLine = reader.readLine();
    }

    return nextLine;

}
 
开发者ID:react-dev26,项目名称:NGB-master,代码行数:24,代码来源:BedSorter.java

示例3: writeHeader

import htsjdk.tribble.readers.AsciiLineReader; //导入方法依赖的package包/类
@Override
String writeHeader(AsciiLineReader reader, PrintWriter writer) {
    try {
        String nextLine = reader.readLine();
        while (nextLine.startsWith("#")) {
            writer.println(nextLine);
            nextLine = reader.readLine();
        }

        return nextLine;
    } catch (IOException e) {
        LOG.error("Error writing header", e);
        return null;
    }


}
 
开发者ID:react-dev26,项目名称:NGB-master,代码行数:18,代码来源:VCFSorter.java

示例4: writeHeader

import htsjdk.tribble.readers.AsciiLineReader; //导入方法依赖的package包/类
@Override
String writeHeader(AsciiLineReader reader, PrintWriter writer) {
    try {
        String nextLine = reader.readLine();
        // TODO -- check "browser" line syntax,  is it a multi-line directive?
        while (nextLine.startsWith("#")) {
            writer.println(nextLine);
            nextLine = reader.readLine();
        }

        return nextLine;
    } catch (IOException e) {
        log.error("Error writing header", e);
        return null;
    }


}
 
开发者ID:hyounesy,项目名称:ALEA,代码行数:19,代码来源:VCFSorter.java

示例5: isWiggle

import htsjdk.tribble.readers.AsciiLineReader; //导入方法依赖的package包/类
/**
 * Utility method.  Returns true if this looks like a wiggle locator.  The criteria is to scan
 * the first 100 lines looking for a valid "track" line.  According to UCSC documentation
 * track lines must contain a type attribute,  which must be equal to "wiggle_0".
 *
 * @param file
 * @return
 */
public static boolean isWiggle(ResourceLocator file) {
    AsciiLineReader reader = null;
    try {
        reader = ParsingUtils.openAsciiReader(file);
        String nextLine = null;
        int lineNo = 0;
        while ((nextLine = reader.readLine()) != null && (nextLine.trim().length() > 0)) {
            if (nextLine.startsWith("track") && nextLine.contains("wiggle_0")) {
                return true;
            }
            if (lineNo++ > 100) {
                break;
            }
        }
    } catch (IOException e) {
        e.printStackTrace();
        return false;
    } finally {
        if (reader != null) {
            reader.close();
        }
    }
    return false;
}
 
开发者ID:hyounesy,项目名称:ALEA,代码行数:33,代码来源:ToolsWiggleParser.java

示例6: writeHeader

import htsjdk.tribble.readers.AsciiLineReader; //导入方法依赖的package包/类
@Override
String writeHeader(AsciiLineReader reader, PrintWriter writer) throws IOException {

    String nextLine = reader.readLine();

    if (nextLine.startsWith("psLayout")) {
        do {
            writer.println(nextLine);
            nextLine = reader.readLine();
        } while (!nextLine.startsWith("-"));
        nextLine = reader.readLine();
    }
    // TODO -- check "browser" line syntax,  is it a multi-line directive?
    while (nextLine.startsWith("#") ||
            nextLine.startsWith("browser") ||
            nextLine.startsWith("track") ||
            nextLine.trim().length() == 0) {
        writer.println(nextLine);
        nextLine = reader.readLine();
    }

    return nextLine;


}
 
开发者ID:hyounesy,项目名称:ALEA,代码行数:26,代码来源:GenericSorter.java

示例7: writeHeader

import htsjdk.tribble.readers.AsciiLineReader; //导入方法依赖的package包/类
@Override
String writeHeader(AsciiLineReader reader, PrintWriter writer) {
    String nextLine = null;

    try {
        nextLine = reader.readLine();
        while (nextLine.startsWith("#")) {
            writer.println(nextLine);
            nextLine = reader.readLine();
        }
    } catch (IOException e) {
        e.printStackTrace();
    }

    return nextLine;
}
 
开发者ID:hyounesy,项目名称:ALEA,代码行数:17,代码来源:GFFSorter.java

示例8: writeHeader

import htsjdk.tribble.readers.AsciiLineReader; //导入方法依赖的package包/类
@Override
String writeHeader(AsciiLineReader reader, PrintWriter writer) throws IOException {

    String nextLine;
    while((nextLine = reader.readLine()) != null) {
        writer.println(nextLine);
        if (!nextLine.startsWith("#")) {
            break;
        }
    }
    return null;

}
 
开发者ID:hyounesy,项目名称:ALEA,代码行数:14,代码来源:GWASSorter.java

示例9: loadFromFile

import htsjdk.tribble.readers.AsciiLineReader; //导入方法依赖的package包/类
/**
 * Load segmented data from a file could be remote)
 * Return a map of trackId -> segment datasource
 *
 * @return
 */
public SegmentedAsciiDataSet loadFromFile() {

    dataset = new SegmentedAsciiDataSet(genome);

    if (birdsuite) {
        dataset.setTrackType(TrackType.CNV);
    }

    AsciiLineReader reader = null;
    String nextLine = null;
    int lineNumber = 0;

    IParser<String[], Integer> parser = IParserFactory.getIndexParser(new String[0]);

    try {
        reader = ParsingUtils.openAsciiReader(locator);
        lineNumber = readHeader(reader);

        while ((nextLine = reader.readLine()) != null && (nextLine.trim().length() > 0)) {
            lineNumber++;
            String[] tokens = Globals.tabPattern.split(nextLine, -1);
            parseLine(parser, tokens);
        }

    } catch (IOException e) {
        if (nextLine != null && lineNumber != 0) {
            throw new ParserException(e.getMessage(), e, lineNumber, nextLine);
        } else {
            throw new RuntimeException(e);
        }
    } finally {
        if (reader != null) {
            reader.close();
        }
    }

    dataset.sortLists();
    return dataset;
}
 
开发者ID:hyounesy,项目名称:ALEA,代码行数:46,代码来源:SegmentedReader.java

示例10: readHeader

import htsjdk.tribble.readers.AsciiLineReader; //导入方法依赖的package包/类
private int readHeader(AsciiLineReader reader) throws IOException {
    // Parse comments, if any
    String nextLine = reader.readLine();
    int lineNumber = 0;
    while (nextLine.startsWith("#") || (nextLine.trim().length() == 0)) {
        lineNumber++;
        if (nextLine.length() > 0) {
            parseComment(nextLine, dataset);
        }
        nextLine = reader.readLine();
    }

    // Read column headings
    headings = nextLine.split("\t");

    if (birdsuite) {
        //sample	sample_index	copy_number	chr	start	end	confidence
        sampleColumn = 0;
        dataColumn = 2;
        chrColumn = 3;
        startColumn = 4;
        endColumn = 5;

    } else {
        sampleColumn = 0;
        chrColumn = 1;
        startColumn = 2;
        endColumn = 3;
        dataColumn = headings.length - 1;
    }

    return lineNumber;
}
 
开发者ID:hyounesy,项目名称:ALEA,代码行数:34,代码来源:SegmentedReader.java

示例11: parseHeader

import htsjdk.tribble.readers.AsciiLineReader; //导入方法依赖的package包/类
private void parseHeader() {
    AsciiLineReader reader = null;

    // The DataConsumer interface takes an array of data per position, however wig
    // files contain a single data point.  Create an "array" once that can
    // be resused

    try {

        reader = ParsingUtils.openAsciiReader(resourceLocator);

        while ((nextLine = reader.readLine()) != null && (nextLine.trim().length() > 0)) {

            // Skip comment lines
            if (nextLine.startsWith("#") || nextLine.startsWith("data") || nextLine.startsWith(
                    "browser") || nextLine.trim().length() == 0) {
                continue;
            }

            if (nextLine.startsWith("track")) {
                trackLine = nextLine;

            } else {
                return;
            }
        }
    } catch (IOException e) {
        e.printStackTrace();
    } finally {
        if (reader != null) {
            reader.close();
        }
    }
}
 
开发者ID:hyounesy,项目名称:ALEA,代码行数:35,代码来源:ToolsWiggleParser.java

示例12: loadKnownSnps

import htsjdk.tribble.readers.AsciiLineReader; //导入方法依赖的package包/类
/**
 * Load the set of known snps from a tab delimited file, format
 * chr < tab> location
 * The location is "1 base"  (first nucleotide is position 1).
 *
 * @param snpFile
 */
private static synchronized void loadKnownSnps(String snpFile) {

    // This method might get called many times concurrently, but we only want to load these once.
    if (knownSnps != null) {
        return;
    }

    knownSnps = new HashMap();
    AsciiLineReader reader = null;
    try {
        reader = ParsingUtils.openAsciiReader(new ResourceLocator(snpFile));
        String nextLine = "";
        while ((nextLine = reader.readLine()) != null) {
            String[] tokens = nextLine.split("\t");
            String chr = tokens[0];
            Set<Integer> snps = knownSnps.get(chr);
            if (snps == null) {
                snps = new HashSet(10000);
                knownSnps.put(chr, snps);
            }
            snps.add(new Integer(tokens[1]));
        }
    } catch (Exception e) {
        knownSnps = null;
        log.error("", e);
        MessageUtils.showMessage("Error loading snps file: " + snpFile + " (" + e.toString() + ")");
    } finally {
        reader.close();
    }


}
 
开发者ID:hyounesy,项目名称:ALEA,代码行数:40,代码来源:BaseAlignmentCounts.java

示例13: readNextRecord

import htsjdk.tribble.readers.AsciiLineReader; //导入方法依赖的package包/类
public DotAlignedAlignment readNextRecord(AsciiLineReader reader) {
    String nextLine;
    try {
        while ((nextLine = reader.readLine()) != null) {
            DotAlignedAlignment alignment = createAlignment(nextLine);
            if (alignment != null) {
                return alignment;
            }
        }
    } catch (IOException e) {
        log.error("Error reading line", e);
    }
    return null;
}
 
开发者ID:hyounesy,项目名称:ALEA,代码行数:15,代码来源:DotAlignedParser.java

示例14: readNextRecord

import htsjdk.tribble.readers.AsciiLineReader; //导入方法依赖的package包/类
public Alignment readNextRecord(AsciiLineReader reader) throws IOException {

        String nextLine;
        while ((nextLine = reader.readLine()) != null) {

            Feature f = codec.decode(nextLine);
            if(f != null && f instanceof BasicFeature) {
                return new FeatureWrappedAlignment((BasicFeature) f);
            }
        }
        return null;

    }
 
开发者ID:hyounesy,项目名称:ALEA,代码行数:14,代码来源:PSLAlignmentParser.java

示例15: getFilter

import htsjdk.tribble.readers.AsciiLineReader; //导入方法依赖的package包/类
public static synchronized ReadGroupFilter getFilter() {

        PreferenceManager samPrefs = PreferenceManager.getInstance();

        if (samPrefs.getAsBoolean(PreferenceManager.SAM_FILTER_ALIGNMENTS)) {

            String filterURL = samPrefs.get(PreferenceManager.SAM_FILTER_URL);

            ReadGroupFilter filter = filterURL == null ? null : filterCache.get(filterURL);

            if (filter == null && filterURL != null && filterURL.trim().length() > 0) {
                Set<String> readGroups = new HashSet();
                AsciiLineReader reader = null;
                try {
                    reader = ParsingUtils.openAsciiReader(new ResourceLocator(filterURL));
                    String nextLine;
                    while ((nextLine = reader.readLine()) != null) {
                        readGroups.add(nextLine.trim());
                    }
                    filter = new ReadGroupFilter(readGroups);
                    filterCache.put(filterURL, filter);
                }
                catch (Exception e) {
                    MessageUtils.showMessage("Error reading read filter list: " + e.getMessage());
                }
            }
            return filter;
        }
        return null;

    }
 
开发者ID:hyounesy,项目名称:ALEA,代码行数:32,代码来源:ReadGroupFilter.java


注:本文中的htsjdk.tribble.readers.AsciiLineReader.readLine方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。