• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SAMSequenceDictionary类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中htsjdk.samtools.SAMSequenceDictionary的典型用法代码示例。如果您正苦于以下问题:Java SAMSequenceDictionary类的具体用法?Java SAMSequenceDictionary怎么用?Java SAMSequenceDictionary使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: getStaticDataInstance

import htsjdk.samtools.SAMSequenceDictionary; //导入依赖的package包/类
public static StaticData getStaticDataInstance(RefContigInfo refContigInfo,
                                               boolean useGVCF,
                                               SamHeaderInfo samHeaderInfo,
                                               VcfHeaderInfo vcfHeaderInfo) {
    StaticData data = new StaticData();
    SAMSequenceDictionary samSequenceDictionary = SAMSequenceDictTransfer.transfer(refContigInfo);
    data.genomeLocParser = new GenomeLocParser(samSequenceDictionary);
    samHeaderInfo.addReadGroupInfo(ReadGroupInfo.apply("rg1", "sample1"));
    SAMFileHeader header = SAMHeaderTransfer.transfer(samHeaderInfo);
    List<SAMReadGroupRecord> readGroupInfos = header.getReadGroups();
    List<String> samples = new ArrayList<>();
    for (SAMReadGroupRecord readGroup : readGroupInfos) {
        samples.add(readGroup.getSample());
    }
    data.haplotypeCaller = new HaplotypeCaller(data.genomeLocParser, samples, useGVCF);
    data.basic2SAMRecordTransfer = new Basic2SAMRecordTransfer(header);

    VCFCodec codec = new VCFCodec();
    VCFHeaderLineIterable headerLineIterable = new VCFHeaderLineIterable(vcfHeaderInfo);
    data.vcfFileHeader = (VCFHeader) codec.readActualHeader(headerLineIterable);
    data.codec = codec;
    return data;
}
 
开发者ID:PAA-NCIC,项目名称:SparkSeq,代码行数:24,代码来源:HaplotypeCallerAdapter.java


示例2: getRecalTableLines

import htsjdk.samtools.SAMSequenceDictionary; //导入依赖的package包/类
public static List<String> getRecalTableLines(RefContigInfo refContigInfo,
                                              SamRecordPartition samRecordPartition,
                                              FastaPartition refPartition,
                                              List<VcfRecordPartition> rodPartitions) {
    SAMSequenceDictionary samSequenceDictionary = SAMSequenceDictTransfer.transfer(refContigInfo);
    GenomeLocParser parser = new GenomeLocParser(samSequenceDictionary);

    SamContentProvider samContentProvider = new SamContentProvider(samRecordPartition);
    RefContentProvider refContentProvider = new RefContentProvider(samSequenceDictionary, refPartition);

    List<RODContentProvider> rodContentProviders = new java.util.ArrayList<>();
    rodPartitions.forEach(
            rodPartition -> rodContentProviders.add(
                    new RODContentProvider(RODNames.KNOWN_ALLELES + rodPartition.key(), rodPartition, parser))
    );

    // 生成recal table
    BaseRecalibrator baseRecalibrator = new BaseRecalibrator(
            parser, refContentProvider, samContentProvider, rodContentProviders);
    baseRecalibrator.run();

    GATKReport bqsrTable = baseRecalibrator.getReport();

    return GATKReportTransfer.report2Lines(bqsrTable);
}
 
开发者ID:PAA-NCIC,项目名称:SparkSeq,代码行数:26,代码来源:BaseRecalibratorAdapter.java


示例3: compareLocatables

import htsjdk.samtools.SAMSequenceDictionary; //导入依赖的package包/类
public static final int compareLocatables(GenomeLocation first, GenomeLocation second, SAMSequenceDictionary dictionary) {
    Utils.nonNull(first);
    Utils.nonNull(second);
    Utils.nonNull(dictionary);

    int result = 0;
    if(first != second) {
        // compare the contigs
        result = compareContigs(first, second, dictionary);
        if (result == 0) {
            // compare start position
            result = Integer.compare(first.getStart(), second.getStart());
            if (result == 0) {
                // compare end position
                result = Integer.compare(first.getStop(), second.getStop());
            }
        }
    }
    return result;
}
 
开发者ID:BGI-flexlab,项目名称:SOAPgaea,代码行数:21,代码来源:GenomeLocation.java


示例4: writeOutRecalibrationTable

import htsjdk.samtools.SAMSequenceDictionary; //导入依赖的package包/类
public void writeOutRecalibrationTable(final VariantContextWriter recalWriter,
		final SAMSequenceDictionary seqDictionary) {
	// we need to sort in coordinate order in order to produce a valid VCF
	Collections.sort(data, VariantDatum.getComparator(seqDictionary));

	// create dummy alleles to be used
	List<Allele> alleles = Arrays.asList(Allele.create("N", true), Allele.create("<VQSR>", false));

	for (final VariantDatum datum : data) {
		if (VRAC.useASannotations)
			alleles = Arrays.asList(datum.referenceAllele, datum.alternateAllele); 
		VariantContextBuilder builder = new VariantContextBuilder("VQSR", datum.loc.getContig(),
				datum.loc.getStart(), datum.loc.getStop(), alleles);
		builder.attribute(VCFConstants.END_KEY, datum.loc.getStop());
		builder.attribute(GaeaVCFConstants.VQS_LOD_KEY, String.format("%.4f", datum.lod));
		builder.attribute(GaeaVCFConstants.CULPRIT_KEY,
				(datum.worstAnnotation != -1 ? annotationKeys.get(datum.worstAnnotation) : "NULL"));

		if (datum.atTrainingSite)
			builder.attribute(GaeaVCFConstants.POSITIVE_LABEL_KEY, true);
		if (datum.atAntiTrainingSite)
			builder.attribute(GaeaVCFConstants.NEGATIVE_LABEL_KEY, true);

		recalWriter.add(builder.make());
	}
}
 
开发者ID:BGI-flexlab,项目名称:SOAPgaea,代码行数:27,代码来源:VariantDataManager.java


示例5: createVCFWriter

import htsjdk.samtools.SAMSequenceDictionary; //导入依赖的package包/类
public static VariantContextWriter createVCFWriter(final File outFile,
		final SAMSequenceDictionary referenceDictionary, final boolean createMD5, final Options... options) {
	Utils.nonNull(outFile);

	VariantContextWriterBuilder vcWriterBuilder = new VariantContextWriterBuilder().clearOptions()
			.setOutputFile(outFile);

	if (createMD5) {
		vcWriterBuilder.setCreateMD5();
	}

	if (null != referenceDictionary) {
		vcWriterBuilder = vcWriterBuilder.setReferenceDictionary(referenceDictionary);
	}

	for (Options opt : options) {
		vcWriterBuilder = vcWriterBuilder.setOption(opt);
	}

	return vcWriterBuilder.build();
}
 
开发者ID:BGI-flexlab,项目名称:SOAPgaea,代码行数:22,代码来源:VariantRecalibrator.java


示例6: parseGFF

import htsjdk.samtools.SAMSequenceDictionary; //导入依赖的package包/类
static void parseGFF(File gffFile, File outfile, String genome, String genomeFile) {		
	
		try {
			
			SAMSequenceDictionary dict = ReadDict(new File(genomeFile));				
			
			FileRead.readGFF(gffFile, outfile.getCanonicalPath(), dict);
		}
		catch(Exception e) {
			e.printStackTrace();
		}
		/*	Main.addGenome
			Main.genomehash.get(genome).add(outfile);	
			JMenuItem additem = new JMenuItem(outfile.getName().substring(0,outfile.getName().indexOf(".gff")));
			additem.setName(outfile.getName().substring(0,outfile.getName().indexOf(".gff")));
			additem.addMouseListener(Main.frame);
			Main.addMenu.add(additem);
			
			break;
		*/
		
	
}
 
开发者ID:rkataine,项目名称:BasePlayer,代码行数:24,代码来源:AddGenome.java


示例7: addIntervalFeatureTrackFromVCF

import htsjdk.samtools.SAMSequenceDictionary; //导入依赖的package包/类
private void addIntervalFeatureTrackFromVCF(String sourceName, GenomicCoords gc, String trackTag) throws ClassNotFoundException, IOException, InvalidGenomicCoordsException, InvalidRecordException, SQLException {
	
	int idForTrack= this.getNextTrackId();
	// String trackId= new File(sourceName).getName() + "#" + idForTrack;
	String trackId= sourceName + "#" + idForTrack;
	
	// If this VCF file has sequence dictionary, check the coordinates in gc are compatible
	// If they are not, throw an exception which force resetting the coords.
	SAMSequenceDictionary seqDict = Utils.getVCFHeader(sourceName).getSequenceDictionary();
	
	if(seqDict != null && seqDict.getSequence(gc.getChrom()) == null){
		throw new InvalidGenomicCoordsException();
	}
	TrackIntervalFeature tif= new TrackIntervalFeature(sourceName, gc);
	tif.setTrackTag(trackId);
	this.trackList.add(tif);
}
 
开发者ID:dariober,项目名称:ASCIIGenome,代码行数:18,代码来源:TrackSet.java


示例8: setSamSeqDictFromBam

import htsjdk.samtools.SAMSequenceDictionary; //导入依赖的package包/类
private boolean setSamSeqDictFromBam(String bamfile) {

		/*  ------------------------------------------------------ */
		/* This chunk prepares SamReader from local bam            */
		SamReaderFactory srf=SamReaderFactory.make();
		srf.validationStringency(ValidationStringency.SILENT);
		SamReader samReader;
		samReader= srf.open(new File(bamfile));
		/*  ------------------------------------------------------ */
		
		SAMSequenceDictionary seqDict = samReader.getFileHeader().getSequenceDictionary();
		if(seqDict != null && !seqDict.isEmpty()){
			this.setSamSeqDictSource(new File(bamfile).getAbsolutePath());
			this.setSamSeqDict(seqDict);
			return true;
		}
		return false;
	}
 
开发者ID:dariober,项目名称:ASCIIGenome,代码行数:19,代码来源:GenomicCoords.java


示例9: isValidPosition

import htsjdk.samtools.SAMSequenceDictionary; //导入依赖的package包/类
/** Return true if the GenomicCoords object is valid given the SAMSequenceDictionary. I.e.
 * gc contig and position is part of the dictionary.   
 * */
private boolean isValidPosition(GenomicCoords gc, SAMSequenceDictionary samSeqDict){

	if(samSeqDict == null || gc == null){
		return true;
	}
	
	HashMap<String, Integer> chromLen= new HashMap<String, Integer>();
	for(SAMSequenceRecord x : gc.getSamSeqDict().getSequences()){
		chromLen.put(x.getSequenceName(), x.getSequenceLength());
	}
	boolean isValid= false;
	if( chromLen.containsKey(gc.getChrom()) ){
		int len= chromLen.get(gc.getChrom());
		if(gc.getTo() <= len){
			isValid= true; 
		}
	} 
	return isValid;
	
}
 
开发者ID:dariober,项目名称:ASCIIGenome,代码行数:24,代码来源:GenomicCoordsHistory.java


示例10: encodeAll

import htsjdk.samtools.SAMSequenceDictionary; //导入依赖的package包/类
@Override
public Map<String, Object> encodeAll(OutputStream outputStream, Iterator<? extends VCFVariant> features) throws IOException {

    SAMSequenceDictionary seqDict = new SAMSequenceDictionary();
    EnumSet<Options> options = VariantContextWriterFactory.DEFAULT_OPTIONS;
    options.add(Options.ALLOW_MISSING_FIELDS_IN_HEADER);
    options.remove(Options.INDEX_ON_THE_FLY);
    VariantContextWriter writer = VariantContextWriterFactory.create(outputStream, seqDict, options);

    writer.writeHeader(this.header);

    while(features.hasNext()){
        writer.add(features.next().getVariantContext());
    }

    return null;
}
 
开发者ID:hyounesy,项目名称:ALEA,代码行数:18,代码来源:VCFEncoder.java


示例11: setupPipeline

import htsjdk.samtools.SAMSequenceDictionary; //导入依赖的package包/类
@Override
protected void setupPipeline(final Pipeline pipeline) {
    final ReadsDataflowSource readsSource = new ReadsDataflowSource(bam, pipeline);
    final SAMFileHeader header = readsSource.getHeader();
    final SAMSequenceDictionary sequenceDictionary = header.getSequenceDictionary();
    final List<SimpleInterval> intervals = intervalArgumentCollection.intervalsSpecified() ? intervalArgumentCollection.getIntervals(sequenceDictionary):
            IntervalUtils.getAllIntervalsForReference(sequenceDictionary);

    final PCollectionView<SAMFileHeader> headerPcolView = pipeline.apply(Create.of(header)).apply(View.<SAMFileHeader>asSingleton());

    final PCollection<GATKRead> preads = readsSource.getReadPCollection(intervals);

    final OpticalDuplicateFinder finder = opticalDuplicatesArgumentCollection.READ_NAME_REGEX != null ?
        new OpticalDuplicateFinder(opticalDuplicatesArgumentCollection.READ_NAME_REGEX, opticalDuplicatesArgumentCollection.OPTICAL_DUPLICATE_PIXEL_DISTANCE, null) : null;
    final PCollectionView<OpticalDuplicateFinder> finderPcolView = pipeline.apply(Create.of(finder)).apply(View.<OpticalDuplicateFinder>asSingleton());

    final PCollection<GATKRead> results = preads.apply(new MarkDuplicates(headerPcolView, finderPcolView));

    // TODO: support writing large output files (need a sharded BAM writer)
    SmallBamWriter.writeToFile(pipeline, results, header, outputFile);

    if (metricsFile != null) {
        final PCollection<KV<String,DuplicationMetrics>> metrics = results.apply(new MarkDuplicatesDataflowUtils.GenerateMetricsTransform(headerPcolView));
        MarkDuplicatesDataflowUtils.writeMetricsToFile(pipeline, metrics, header, metricsFile);
    }
}
 
开发者ID:broadinstitute,项目名称:gatk-dataflow,代码行数:27,代码来源:MarkDuplicatesDataflow.java


示例12: setupPipeline

import htsjdk.samtools.SAMSequenceDictionary; //导入依赖的package包/类
@Override
protected void setupPipeline(Pipeline pipeline) {
    if (readArguments.getReadFilesNames().size()>1) {
        throw new UserException("Sorry, we only support a single input file for now.");
    }
    final String filename = readArguments.getReadFilesNames().get(0);
    final ReadsDataflowSource readsSource = new ReadsDataflowSource(filename, pipeline);
    final SAMFileHeader header = readsSource.getHeader();
    final PCollectionView<SAMFileHeader> headerView = pipeline.apply(Create.of(header)).apply(View.asSingleton());
    final SAMSequenceDictionary sequenceDictionary = header.getSequenceDictionary();
    final List<SimpleInterval> intervals = intervalArgumentCollection.intervalsSpecified() ? intervalArgumentCollection.getIntervals(sequenceDictionary)
            : IntervalUtils.getAllIntervalsForReference(sequenceDictionary);
    final PCollectionView<BaseRecalOutput> recalInfoSingletonView = BaseRecalOutputSource.loadFileOrRemote(pipeline, BQSR_RECAL_FILE_NAME).apply(View.asSingleton());
    final PCollection<GATKRead> output = readsSource.getReadPCollection(intervals, ValidationStringency.SILENT, false)
            .apply(new ApplyBQSRTransform(headerView, recalInfoSingletonView, bqsrOpts));
    intermediateRemoteBam = OUTPUT;
    if (needsIntermediateCopy()) {
        // The user specified remote execution and provided a local file name. So we're going to have to save to remote storage as a go-between.
        // Note that this may require more permissions
        intermediateRemoteBam = BucketUtils.randomRemotePath(stagingLocation, "temp-applyBqsr-output-", ".bam");
        logger.info("Staging results at " + intermediateRemoteBam);
    }
    SmallBamWriter.writeToFile(pipeline, output, header, intermediateRemoteBam);
}
 
开发者ID:broadinstitute,项目名称:gatk-dataflow,代码行数:25,代码来源:ApplyBQSRDataflow.java


示例13: resolveTargetCollection

import htsjdk.samtools.SAMSequenceDictionary; //导入依赖的package包/类
/**
 * Builds the target collection given the values of user arguments.
 *
 * @throws UserException if there is some inconsistency in user arguments and inputs.
 * @throws GATKException if there was any problem parsing the content of the targets file.
 * @return never {@code null}.
 */
private TargetCollection<Target> resolveTargetCollection() {
    final TargetCollection<Target> result;
    if (targetsFile != null) {
        result = resolveTargetsFromFile();
    } else if (hasIntervals()) {
        final SAMSequenceDictionary sequenceDictionary = getBestAvailableSequenceDictionary();
        final List<SimpleInterval> intervals = intervalArgumentCollection.getIntervals(sequenceDictionary);

        //this constructor automatically generates target names from the intervals
        final List<Target> targets = intervals.stream().map(Target::new).collect(Collectors.toList());
        result = new HashedListTargetCollection<>(targets);
    } else {
        throw new UserException(String.format("You must indicate the set of target as input intervals (e.g. -L target-intervals.list) or a target feature file (e.g. -%s my-targets.tsv) ", TARGET_FILE_SHORT_NAME));
    }
    if (targetOutInfo.requiresUniqueTargetName()) {
        checkAllTargetsHaveName(result);
    }
    return result;
}
 
开发者ID:broadinstitute,项目名称:gatk-protected,代码行数:27,代码来源:CalculateTargetCoverage.java


示例14: onTraversalStart

import htsjdk.samtools.SAMSequenceDictionary; //导入依赖的package包/类
@Override
public void onTraversalStart() {
    ParamUtils.isPositive(scatterCount, "scatter count must be > 0.");

    if (!outputDir.exists() && !outputDir.mkdir()) {
        throw new RuntimeIOException("Unable to create directory: " + outputDir.getAbsolutePath());
    }

    // in general dictionary will be from the reference, but using -I reads.bam or -F variants.vcf
    // to use the sequence dict from a bam or vcf is also supported
    final SAMSequenceDictionary sequenceDictionary = getBestAvailableSequenceDictionary();

    final List<SimpleInterval> intervals = hasIntervals() ? intervalArgumentCollection.getIntervals(sequenceDictionary)
            : IntervalUtils.getAllIntervalsForReference(sequenceDictionary);

    final IntervalList intervalList = new IntervalList(sequenceDictionary);
    intervals.stream().map(si -> new Interval(si.getContig(), si.getStart(), si.getEnd())).forEach(intervalList::add);
    final IntervalListScatterer scatterer = new IntervalListScatterer(subdivisionMode);
    final List<IntervalList> scattered = scatterer.scatter(intervalList, scatterCount, false);

    final DecimalFormat formatter = new DecimalFormat("0000");
    IntStream.range(0, scattered.size()).forEach(n -> scattered.get(n).write(new File(outputDir, formatter.format(n) + "-scattered.intervals")));
}
 
开发者ID:broadinstitute,项目名称:gatk-protected,代码行数:24,代码来源:SplitIntervals.java


示例15: makeVCFWriter

import htsjdk.samtools.SAMSequenceDictionary; //导入依赖的package包/类
/**
 * Create a VCF or GVCF writer as appropriate, given our arguments
 *
 * @param outputVCF location to which the vcf should be written
 * @param readsDictionary sequence dictionary for the reads
 * @return a VCF or GVCF writer as appropriate, ready to use
 */
public VariantContextWriter makeVCFWriter( final String outputVCF, final SAMSequenceDictionary readsDictionary ) {
    Utils.nonNull(outputVCF);
    Utils.nonNull(readsDictionary);

    VariantContextWriter writer = GATKVariantContextUtils.createVCFWriter(new File(outputVCF), readsDictionary, false);

    if ( hcArgs.emitReferenceConfidence == ReferenceConfidenceMode.GVCF ) {
        try {
            writer = new GVCFWriter(writer, hcArgs.GVCFGQBands, hcArgs.genotypeArgs.samplePloidy);
        } catch ( IllegalArgumentException e ) {
            throw new CommandLineException.BadArgumentValue("GQBands", "are malformed: " + e.getMessage());
        }
    }

    return writer;
}
 
开发者ID:broadinstitute,项目名称:gatk-protected,代码行数:24,代码来源:HaplotypeCallerEngine.java


示例16: writeHeader

import htsjdk.samtools.SAMSequenceDictionary; //导入依赖的package包/类
public void writeHeader(final VariantContextWriter vcfWriter, final SAMSequenceDictionary sequenceDictionary,
                        final Set<VCFHeaderLine>  defaultToolHeaderLines) {
    final Set<VCFHeaderLine> headerInfo = new HashSet<>();

    // all annotation fields from VariantAnnotatorEngine
    headerInfo.addAll(annotationEngine.getVCFAnnotationDescriptions());
    headerInfo.addAll(defaultToolHeaderLines);

    // all callers need to add these standard FORMAT field header lines
    VCFStandardHeaderLines.addStandardFormatLines(headerInfo, true,
            VCFConstants.GENOTYPE_KEY,
            VCFConstants.GENOTYPE_ALLELE_DEPTHS,
            VCFConstants.GENOTYPE_QUALITY_KEY,
            VCFConstants.DEPTH_KEY,
            VCFConstants.GENOTYPE_PL_KEY);

    headerInfo.addAll(getM2HeaderLines());
    headerInfo.addAll(getSampleHeaderLines());

    final VCFHeader vcfHeader = new VCFHeader(headerInfo, samplesList.asListOfSamples());
    vcfHeader.setSequenceDictionary(sequenceDictionary);
    vcfWriter.writeHeader(vcfHeader);
}
 
开发者ID:broadinstitute,项目名称:gatk-protected,代码行数:24,代码来源:Mutect2Engine.java


示例17: createRandomIntervals

import htsjdk.samtools.SAMSequenceDictionary; //导入依赖的package包/类
private List<SimpleInterval> createRandomIntervals(final SAMSequenceDictionary referenceDictionary, final int numberOfIntervals, final int minIntervalSize, final int maxIntervalSize, final int meanIntervalSize, final double intervalSizeStdev) {
    final List<SimpleInterval> result = new ArrayList<>(numberOfIntervals);
    final int numberOfSequences = referenceDictionary.getSequences().size();
    for (int i = 0; i < numberOfIntervals; i++) {
        final SAMSequenceRecord contig = referenceDictionary.getSequence(RANDOM.nextInt(numberOfSequences));
        final String contigName = contig.getSequenceName();
        final int intervalSize = Math.min(maxIntervalSize, (int) Math.max(minIntervalSize, Math.round(RANDOM.nextDouble() * intervalSizeStdev + meanIntervalSize)));
        final int intervalStart = 1 + RANDOM.nextInt(contig.getSequenceLength() - intervalSize);
        final int intervalEnd = intervalStart + intervalSize - 1;
        final SimpleInterval interval = new SimpleInterval(contigName, intervalStart, intervalEnd);
        result.add(interval);
    }

    final Comparator<SimpleInterval> comparator =
            Comparator.comparing(SimpleInterval::getContig,
                    (a, b) -> Integer.compare(
                            referenceDictionary.getSequenceIndex(a),
                            referenceDictionary.getSequenceIndex(b)))
            .thenComparingInt(SimpleInterval::getStart)
            .thenComparingInt(SimpleInterval::getEnd);
    Collections.sort(result, comparator);
    return result;
}
 
开发者ID:broadinstitute,项目名称:gatk-protected,代码行数:24,代码来源:AnnotateTargetsIntegrationTest.java


示例18: testGetBestAvailableSequenceDictionaryWithMasterDictionary

import htsjdk.samtools.SAMSequenceDictionary; //导入依赖的package包/类
@Test(dataProvider = "provideMultipleSequenceDictionaries")
public void testGetBestAvailableSequenceDictionaryWithMasterDictionary(String sequenceFileName,
                                                           String otherSeqArg, String otherSequenceFile,
                                                           String cramRefArg, String cramRefFile,
                                                           SAMSequenceDictionary expectedDict) {

    final GATKTool tool = new TestGATKToolWithSequenceDictionary();
    final CommandLineParser clp = new CommandLineArgumentParser(tool);

    final String[] args = (cramRefArg == null)
        ? new String[] { "--" + StandardArgumentDefinitions.SEQUENCE_DICTIONARY_NAME, sequenceFileName, otherSeqArg, otherSequenceFile, }
        : new String[] { "--" + StandardArgumentDefinitions.SEQUENCE_DICTIONARY_NAME, sequenceFileName, otherSeqArg, otherSequenceFile, cramRefArg, cramRefFile };

    clp.parseArguments(System.out, args);

    // This initializes our tool
    tool.onStartup();

    // Make sure that the best available dictionary is the expected dictionary
    Assert.assertEquals( tool.getBestAvailableSequenceDictionary(), expectedDict );
}
 
开发者ID:broadinstitute,项目名称:gatk,代码行数:22,代码来源:GATKToolUnitTest.java


示例19: testMCMC

import htsjdk.samtools.SAMSequenceDictionary; //导入依赖的package包/类
@Test
public void testMCMC() {
    final double variance = 0.01;
    final double outlierProbability = 0.05;
    final int numSegments = 100;
    final double averageIntervalsPerSegment = 100.;
    final int numSamples = 150;
    final int numBurnIn = 50;
    final RandomGenerator rng = RandomGeneratorFactory.createRandomGenerator(new Random(RANDOM_SEED));

    final SampleLocatableMetadata metadata = new SimpleSampleLocatableMetadata(
            "test-sample",
            new SAMSequenceDictionary(IntStream.range(0, numSegments)
                    .mapToObj(i -> new SAMSequenceRecord("chr" + i + 1, 10000))
                    .collect(Collectors.toList())));
    final CopyRatioSimulatedData simulatedData = new CopyRatioSimulatedData(
            metadata, variance, outlierProbability, numSegments, averageIntervalsPerSegment, rng);

    final CopyRatioModeller modeller = new CopyRatioModeller(simulatedData.getData().getCopyRatios(), simulatedData.getData().getSegments());
    modeller.fitMCMC(numSamples, numBurnIn);

    assertCopyRatioPosteriorCenters(modeller, simulatedData);
}
 
开发者ID:broadinstitute,项目名称:gatk,代码行数:24,代码来源:CopyRatioModellerUnitTest.java


示例20: testGetMasterSequenceDictionary

import htsjdk.samtools.SAMSequenceDictionary; //导入依赖的package包/类
@Test(dataProvider = "provideForGetMasterSequenceTest")
public void testGetMasterSequenceDictionary(String masterSequenceFileName, String inputFileName, SAMSequenceDictionary expectedDict) {
    final GATKTool tool = new TestGATKToolWithSequenceDictionary();
    final CommandLineParser clp = new CommandLineArgumentParser(tool);

    final String[] args = (masterSequenceFileName == null)
            ? new String[] { "--input", inputFileName, }
            : new String[] { "--" + StandardArgumentDefinitions.SEQUENCE_DICTIONARY_NAME, masterSequenceFileName, "--input", inputFileName, };

    clp.parseArguments(System.out, args);

    // This initializes our tool
    tool.onStartup();

    // Make sure that the master sequence dictionary dictionary is the expected dictionary
    Assert.assertEquals( tool.getMasterSequenceDictionary(), expectedDict );
}
 
开发者ID:broadinstitute,项目名称:gatk,代码行数:18,代码来源:GATKToolUnitTest.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MutableData类代码示例发布时间:2022-05-21
下一篇:
Java FloatType类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap