org.broadinstitute.gatk.utils.Utils.join()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(8.3k)|赞(0)|评价(0)|浏览(150)

本文整理了Java中org.broadinstitute.gatk.utils.Utils.join()方法的一些代码示例,展示了Utils.join()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.join()方法的具体详情如下:
包路径:org.broadinstitute.gatk.utils.Utils
类名称:Utils
方法名:join

Utils.join介绍

[英]Returns a string of the form elt1.toString() [sep elt2.toString() ... sep elt.toString()] for a collection of elti objects (note there's no actual space between sep and the elti elements). Returns "" if collection is empty. If collection contains just elt, then returns elt.toString()
[中]返回形式为elt1的字符串。toString()[sep elt2.toString()…sep elt.toString()]用于一组elti对象(请注意,sep和elti元素之间没有实际空间)。如果集合为空,则返回“”。如果集合只包含elt,则返回elt。toString()

代码示例

代码示例来源:origin: broadgsa/gatk

/**
 * join an array of strings given a seperator
 * @param separator the string to insert between each array element
 * @param strings the array of strings
 * @return a string, which is the joining of all array values with the separator
 */
public static String join(String separator, String[] strings) {
  return join(separator, strings, 0, strings.length);
}

代码示例来源:origin: broadgsa/gatk

/**
 * Provide an initial value for reduce computations.
 *
 * @return Initial value of reduce.
 */
public Integer reduceInit() {
  out.println(Utils.join(" \t", Arrays.asList("ReadGroup", "ReadLength", "NClippingEvents", "NClippedBases", "PercentClipped")));
  return 0;
}

代码示例来源:origin: broadgsa/gatk

/**
 * Returns a comma-separated list of the names of the interfaces implemented by this class
 *
 * @param covClass class
 * @return names of interfaces
 */
public static String classInterfaces(final Class covClass) {
  final List<String> interfaces = new ArrayList<String>();
  for ( final Class interfaceClass : covClass.getInterfaces() )
    interfaces.add(interfaceClass.getSimpleName());
  return Utils.join(", ", interfaces);
}

代码示例来源:origin: broadgsa/gatk

/**
 * Return a human-readable string representing the used covariates
 *
 * @param requestedCovariates a vector of covariates
 * @return a non-null comma-separated string
 */
public static String covariateNames(final Covariate[] requestedCovariates) {
  final List<String> names = new ArrayList<String>(requestedCovariates.length);
  for ( final Covariate cov : requestedCovariates )
    names.add(cov.getClass().getSimpleName());
  return Utils.join(",", names);
}

代码示例来源:origin: broadgsa/gatk

/**
 * Return a human readable string describing the intervals this traverser is operating on
 * @return
 */
public String getIntervalsString() {
  return Utils.join(",", shard.getGenomeLocs());
}

代码示例来源:origin: broadgsa/gatk

/**
   * Get a human-readable list of platform names
   * @return the list of platform names
   */
  public static String knownPlatformsString() {
    final List<String> names = new LinkedList<>();
    for ( final NGSPlatform pl : values() ) {
      names.addAll(Arrays.asList(pl.BAM_PL_NAMES));
    }
    return Utils.join(",", names);
  }
}

代码示例来源:origin: broadgsa/gatk

/**
   * String representation of this shard.
   * @return A string representation of the boundaries of this shard.
   */
  @Override
  public String toString() {
    return Utils.join(";",getGenomeLocs());
  }
}

代码示例来源:origin: broadgsa/gatk-protected

@Override
  public String toString() {
    return "Ls [" + Utils.join(",", Ls) + "] expectedPosteriors [" + Utils.join(",", expectedPosteriors) + "]";
  }
}

代码示例来源:origin: broadgsa/gatk

@Override
public String toOneLineString() {
  StringBuilder b = new StringBuilder();
  b.append('(');
  List<String> parts = new ArrayList<String>();
  for ( DiffElement elt : getElements() )
    parts.add(elt.toOneLineString());
  b.append(Utils.join(" ", parts));
  b.append(')');
  return b.toString();
}

代码示例来源:origin: broadgsa/gatk

@Override
  public String toString() {
    return String.format("QQTest nLevels=%d nObs=[%s] map=[%s]",
        nLevels, Utils.join(",", nObservationsPerQual), Utils.join(",", expectedMap));
  }
}

代码示例来源:origin: broadgsa/gatk-protected

@Requires({"vc != null", "variable != null", "key != null", "value != null", "callReport != null"})
private void printCallElement(final VariantContext vc,
               final Object variable,
               final Object key,
               final Object value) {
  final String loc = String.format("%s:%d", vc.getChr(), vc.getStart());
  callReport.println(Utils.join("\t", Arrays.asList(loc, variable, key, value)));
}

代码示例来源:origin: broadgsa/gatk-protected

@Override
public String toString() {
  final List<String> byAllele = new LinkedList<String>();
  for ( final Allele a : getAllelesUsedInGenotyping() )
    if ( a.isNonReference() ) byAllele.add(String.format("%s => MLE %d / posterior %.2f", a, getAlleleCountAtMLE(a), getLog10PosteriorOfAFEq0ForAllele(a)));
  return String.format("AFCalc%n\t\tlog10PosteriorOfAFGT0=%.2f%n\t\t%s", getLog10LikelihoodOfAFGT0(), Utils.join("\n\t\t", byAllele));
}

代码示例来源:origin: broadgsa/gatk-protected

private String getName() {
  StringBuilder b = new StringBuilder();
  int c = 1;
  for ( List<Object> state : allStates )
    b.append(String.format("%d = [%s] ", c++, Utils.join(",", state)));
  return b.toString();
}

代码示例来源:origin: broadgsa/gatk

private static String insertLengthOutput(final ReadBackedPileup pileup) {
  Integer[] insertSizes=new Integer[pileup.depthOfCoverage()];
  int i=0;
  for ( PileupElement p : pileup ) {
    insertSizes[i]=p.getRead().getInferredInsertSize();
    ++i;
  }
  return Utils.join(",",insertSizes);
}

代码示例来源:origin: broadgsa/gatk

public StateTest(final List<EfficiencyMonitoringThreadFactory.State> statesForThreads) {
  super(StateTest.class);
  this.statesForThreads = statesForThreads;
  setName("StateTest " + Utils.join(",", statesForThreads));
}

代码示例来源:origin: broadgsa/gatk

private final static String sliceContents(EnumSet<PedReader.Field> missingFieldsSet, String full) {
  List<String> parts = new ArrayList<String>(Arrays.asList(full.split("\\s+")));
  final List<PedReader.Field> missingFields = new ArrayList<PedReader.Field>(missingFieldsSet);
  Collections.reverse(missingFields);
  for ( PedReader.Field field : missingFields )
    parts.remove(field.ordinal());
  return Utils.join("\t", parts);
}

代码示例来源:origin: broadgsa/gatk

public String toString() {
  final StringBuilder buf = new StringBuilder();
  buf.append("{ ");
  while ( hasNext() ) {
    buf.append("[");
    buf.append(Utils.join(",",next()));
    buf.append("],");
  }
  buf.deleteCharAt(buf.lastIndexOf(","));
  buf.append(" }");
  return buf.toString();
}

代码示例来源:origin: broadgsa/gatk

private void testRODStream(final ReadMetaDataTrackerRODStreamTest test, final IntervalOverlappingRODsFromStream stream, final List<GenomeLoc> intervals) {
  for ( final GenomeLoc interval : intervals ) {
    final RODRecordList query = stream.getOverlapping(interval);
    final HashSet<Feature> queryFeatures = new HashSet<Feature>();
    for ( final GATKFeature f : query ) queryFeatures.add((Feature)f.getUnderlyingObject());
    final Set<Feature> overlaps = test.getExpectedOverlaps(interval);
    Assert.assertEquals(queryFeatures.size(), overlaps.size(), "IntervalOverlappingRODsFromStream didn't return the expected set of overlapping features." +
        " Expected size = " + overlaps.size() + " but saw " + queryFeatures.size());
    BaseTest.assertEqualsSet(queryFeatures, overlaps, "IntervalOverlappingRODsFromStream didn't return the expected set of overlapping features." +
        " Expected = " + Utils.join(",", overlaps) + " but saw " + Utils.join(",", queryFeatures));
  }
}

代码示例来源:origin: broadgsa/gatk-protected

@Test(enabled = true, dataProvider = "TestCombineGLs")
public void testCombinePrecise(final int altIndex, final int nAlts, final Genotype testg, final Genotype expected) {
  final IndependentAllelesDiploidExactAFCalculator calc = (IndependentAllelesDiploidExactAFCalculator) AFCalculatorImplementation.EXACT_INDEPENDENT.newInstance();
  final Genotype combined = calc.combineGLsPrecise(testg, altIndex, nAlts);
  Assert.assertEquals(combined.getPL(), expected.getPL(),
      "Combined PLs " + Utils.join(",", combined.getPL()) + " != expected " + Utils.join(",", expected.getPL()));
}

代码示例来源:origin: broadgsa/gatk-protected

@Test(enabled = true, dataProvider = "TestCombineGLs")
public void testCombineGLsPrecise(final int altIndex, final int nAlts, final Genotype testg, final Genotype expected) {
  final IndependentAllelesDiploidExactAFCalculator calc = (IndependentAllelesDiploidExactAFCalculator) AFCalculatorImplementation.EXACT_INDEPENDENT.newInstance();
  final Genotype combined = calc.combineGLsPrecise(testg, altIndex, nAlts);
  Assert.assertEquals(combined.getPL(), expected.getPL(),
      "Combined PLs " + Utils.join(",", combined.getPL()) + " != expected " + Utils.join(",", expected.getPL()));
}

相关文章