Package org.broadinstitute.gatk.utils.text

Examples of org.broadinstitute.gatk.utils.text.XReadLines


            in = new GZIPInputStream(in);
        }

        String[] nextEntry;
        String[] thisEntry = null;
        for ( final String line : new XReadLines(in) ) {
            // peak at the next entry (to get the haplotype bases)
            nextEntry = line.split(" ");
            // process the current entry
            if (thisEntry != null) {
                final PairHMMTestData info = new PairHMMTestData(
View Full Code Here


        }

        String previousRead = null;
        String[] nextEntry;
        String[] thisEntry = null;
        for ( final String line : new XReadLines(in) ) {
            // peak at the next entry (to get the haplotype bases)
            nextEntry = line.split(" ");
            // process the current entry
            if (thisEntry != null) {
                final PairHMMTestData info = new PairHMMTestData(
View Full Code Here

    private final File EXPECTED_TRANCHES_OLD = new File(privateTestDir + "tranches.4.txt");

    private ArrayList<VariantDatum> readData() {
        ArrayList<VariantDatum> vd = new ArrayList<VariantDatum>();
        try {
            for ( String line : new XReadLines(QUAL_DATA, true) ) {
                String[] parts = line.split("\t");
                // QUAL,TRANSITION,ID,LOD,FILTER
                if ( ! parts[0].equals("QUAL") ) {
                    VariantDatum datum = new VariantDatum();
                    datum.lod = Double.valueOf(parts[3]);
View Full Code Here

    private Map<String,String> loadFileNameMap(String mapFile) {
        Map<String,String> fname_map = new HashMap<String,String>();

        try {

             XReadLines reader = new XReadLines(new File(mapFile),true);
             for ( String line : reader ) {
                 if ( line.length() == 0 ) continue;

                 String fields[] = line.split("\t");
View Full Code Here

    public static List<Tranche> readTranches(File f) {
        String[] header = null;
        List<Tranche> tranches = new ArrayList<Tranche>();

        try {
            for( final String line : new XReadLines(f) ) {
                if ( line.startsWith("#") )
                    continue;

                final String[] vals = line.split(",");
                if( header == null ) {
View Full Code Here

    public static Collection<String> getSamplesFromFiles (Collection<File> files) {
        Set<String> samplesFromFiles = new HashSet<String>();
        if (files != null) {
            for (File file : files) {
                try {
                    XReadLines reader = new XReadLines(file);
                    List<String> lines = reader.readLines();
                    for (String line : lines) {
                        samplesFromFiles.add(line);
                    }
                } catch (FileNotFoundException e) {
                    throw new UserException.CouldNotReadInputFile(file, e);
View Full Code Here

    public PlatformUnitFilterHelper(String arg) {
         File f = new File(arg);

         if ( f.exists() ) {
             try {
                 XReadLines reader = new XReadLines(f);
                 for ( String line : reader ) {
                     if ( EMPTYLINE_PATTERN.matcher(line).matches() ) continue; // skip empty lines
                     PlatformUnitFilter.addBlackListedLane(line); // PlatformUnitFilter will trim the line as needed
                 }
             } catch ( FileNotFoundException e) { throw new UserException.CouldNotReadInputFile(f, e); } // this should NEVER happen
View Full Code Here

    private void addFilter(Map<String, Collection<String>> filters, String filter, File parentFile, int parentLineNum) {
        if (filter.toLowerCase().endsWith(".list") || filter.toLowerCase().endsWith(".txt")) {
            File file = new File(filter);
            try {
                int lineNum = 0;
                XReadLines lines = new XReadLines(file);
                for (String line : lines) {
                    lineNum++;

                    if (line.trim().length() == 0)
                        continue;
View Full Code Here

        logger.warn("Reading PED string: \"" + source + "\" with missing fields: " + missingFields);
        return parse(new StringReader(source.replace(";", String.format("%n"))), missingFields, sampleDB);
    }

    public final List<Sample> parse(Reader reader, EnumSet<MissingPedField> missingFields, SampleDB sampleDB) {
        final List<String> lines = new XReadLines(reader).readLines();

        // What are the record offsets?
        final int familyPos = missingFields.contains(MissingPedField.NO_FAMILY_ID) ? -1 : 0;
        final int samplePos = familyPos + 1;
        final int paternalPos = missingFields.contains(MissingPedField.NO_PARENTS) ? -1 : samplePos + 1;
View Full Code Here

        logger.info("Renaming samples from input files on-the-fly using mapping file " + sampleRenameMapFile.getAbsolutePath());

        final Map<String, String> sampleRenameMap = new HashMap<>((int)sampleRenameMapFile.length() / 50);

        try {
            for ( final String line : new XReadLines(sampleRenameMapFile) ) {
                final String[] tokens = line.split("\\s+", 2);

                if ( tokens.length != 2 ) {
                    throw new UserException.MalformedFile(sampleRenameMapFile,
                                                          String.format("Encountered a line with %s fields instead of the required 2 fields. Line was: %s",
View Full Code Here

TOP

Related Classes of org.broadinstitute.gatk.utils.text.XReadLines

Copyright © 2018 www.massapicom. 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.