Search in sources :

Example 1 with FastQName

use of com.github.lindenb.jvarkit.util.illumina.FastQName in project jvarkit by lindenb.

the class NgsFilesScanner method getFastqSampleInDirectory.

private Counter<String> getFastqSampleInDirectory(File f) {
    if (f == null || !f.isDirectory() || !f.exists() || !f.canRead())
        return EMPTY_COUNTER;
    File[] array = f.listFiles(this.fastqFilter);
    if (array == null)
        return EMPTY_COUNTER;
    Counter<String> fastqSamples = new Counter<String>();
    for (File f2 : array) {
        FastQName fqName = FastQName.parse(f2);
        if (fqName.isValid() && fqName.getSample() != null) {
            fastqSamples.incr(fqName.getSample(), f2.length());
        }
    }
    return fastqSamples;
}
Also used : FastQName(com.github.lindenb.jvarkit.util.illumina.FastQName) Counter(com.github.lindenb.jvarkit.util.Counter) File(java.io.File)

Example 2 with FastQName

use of com.github.lindenb.jvarkit.util.illumina.FastQName in project jvarkit by lindenb.

the class NgsFilesSummary method readFastq.

@Override
protected void readFastq(final File f) {
    // File parent=f.getParentFile();
    // if(parent==null || super.VERBOSITY==Log.LogLevel.) return;
    final FastQName fq = FastQName.parse(f);
    if (!fq.isValid()) {
        // bad name
        return;
    }
    print(fq.getSample(), InfoType.FASTQ, f);
}
Also used : FastQName(com.github.lindenb.jvarkit.util.illumina.FastQName)

Aggregations

FastQName (com.github.lindenb.jvarkit.util.illumina.FastQName)2 Counter (com.github.lindenb.jvarkit.util.Counter)1 File (java.io.File)1