當前位置: 首頁>>代碼示例>>Java>>正文


Java BucketUtils.fileExists方法代碼示例

本文整理匯總了Java中org.broadinstitute.hellbender.utils.gcs.BucketUtils.fileExists方法的典型用法代碼示例。如果您正苦於以下問題:Java BucketUtils.fileExists方法的具體用法?Java BucketUtils.fileExists怎麽用?Java BucketUtils.fileExists使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.broadinstitute.hellbender.utils.gcs.BucketUtils的用法示例。


在下文中一共展示了BucketUtils.fileExists方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: loadBam

import org.broadinstitute.hellbender.utils.gcs.BucketUtils; //導入方法依賴的package包/類
/**
 * Reads bam from path and returns tuple of the header and reads RDD
 */
private Tuple2<SAMFileHeader, JavaRDD<GATKRead>> loadBam(final String path,
                                                         final ReadsSparkSource readsSource) {
    if (path == null) return null;
    if (BucketUtils.fileExists(path)) {
        final SAMFileHeader header = readsSource.getHeader(path, null);
        if (header.getSequenceDictionary() != null && !header.getSequenceDictionary().isEmpty()) {
            throw new UserException.BadInput("Input BAM should be unaligned, but found one or more sequences in the header.");
        }
        PSBwaUtils.addReferenceSequencesToHeader(header, bwaArgs.referencePath, getReferenceWindowFunction());
        final JavaRDD<GATKRead> reads = readsSource.getParallelReads(path, null, null, bamPartitionSplitSize);
        return new Tuple2<>(header, reads);
    }
    logger.warn("Could not find file " + path + ". Skipping...");
    return null;
}
 
開發者ID:broadinstitute,項目名稱:gatk,代碼行數:19,代碼來源:PathSeqBwaSpark.java

示例2: readInputWithHeader

import org.broadinstitute.hellbender.utils.gcs.BucketUtils; //導入方法依賴的package包/類
private Tuple2<JavaRDD<GATKRead>, SAMFileHeader> readInputWithHeader(final String path,
                                                                     final ReadsSparkSource readsSource) {
    if (path != null) {
        if (BucketUtils.fileExists(path)) {
            recommendedNumReducers += PSUtils.pathseqGetRecommendedNumReducers(path, numReducers, getTargetPartitionSize());
            final SAMFileHeader header = readsSource.getHeader(path, null);
            JavaRDD<GATKRead> reads = readsSource.getParallelReads(path, null, null, bamPartitionSplitSize);
            reads = PSUtils.primaryReads(reads);
            return new Tuple2<>(reads, header);
        } else {
            logger.warn("Could not find file " + path + ". Skipping...");
        }
    }
    return new Tuple2<>(null, null);
}
 
開發者ID:broadinstitute,項目名稱:gatk,代碼行數:16,代碼來源:PathSeqScoreSpark.java


注:本文中的org.broadinstitute.hellbender.utils.gcs.BucketUtils.fileExists方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。