本文整理汇总了Java中htsjdk.samtools.util.StringUtil.join方法的典型用法代码示例。如果您正苦于以下问题:Java StringUtil.join方法的具体用法?Java StringUtil.join怎么用?Java StringUtil.join使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类htsjdk.samtools.util.StringUtil
的用法示例。
在下文中一共展示了StringUtil.join方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkRgTagColumns
import htsjdk.samtools.util.StringUtil; //导入方法依赖的package包/类
/**
* Given a set of columns assert that all columns conform to the format of an RG header attribute (i.e. 2 letters)
* the attribute is NOT a member of the rgHeaderTags that are built by default in buildSamHeaderParameters
*
* @param rgTagColumns A set of columns that should conform to the rg header attribute format
*/
private void checkRgTagColumns(final Set<String> rgTagColumns) {
final Set<String> forbiddenHeaders = buildSamHeaderParameters(null).keySet();
forbiddenHeaders.retainAll(rgTagColumns);
if (!forbiddenHeaders.isEmpty()) {
throw new PicardException("Illegal ReadGroup tags in library params(barcode params) file(" + LIBRARY_PARAMS.getAbsolutePath() + ") Offending headers = " + StringUtil.join(", ", forbiddenHeaders));
}
for (final String column : rgTagColumns) {
if (column.length() > 2) {
throw new PicardException("Column label (" + column + ") unrecognized. Library params(barcode params) can only contain the columns " +
"(OUTPUT, LIBRARY_NAME, SAMPLE_ALIAS, BARCODE, BARCODE_<X> where X is a positive integer) OR two letter RG tags!");
}
}
}
示例2: convertParamsFile
import htsjdk.samtools.util.StringUtil; //导入方法依赖的package包/类
private void convertParamsFile(String libraryParamsFile, int concatNColumnFields, File testDataDir, File outputDir, File libraryParams, List<File> outputPrefixes) throws FileNotFoundException {
try (LineReader reader = new BufferedLineReader(new FileInputStream(new File(testDataDir, libraryParamsFile)))) {
final PrintWriter writer = new PrintWriter(libraryParams);
final String header = reader.readLine();
writer.println(header + "\tOUTPUT_PREFIX");
while (true) {
final String line = reader.readLine();
if (line == null) {
break;
}
final String[] fields = line.split("\t");
final File outputPrefix = new File(outputDir, StringUtil.join("", Arrays.copyOfRange(fields, 0, concatNColumnFields)));
outputPrefixes.add(outputPrefix);
writer.println(line + "\t" + outputPrefix);
}
writer.close();
}
}
示例3: listToStr
import htsjdk.samtools.util.StringUtil; //导入方法依赖的package包/类
public String listToStr(List<String> result) {
if(result.size() > 0) {
return StringUtil.join(VCFConstants.INFO_FIELD_ARRAY_SEPARATOR, result);
} else {
return VCFConstants.EMPTY_ALTERNATE_ALLELE_FIELD;
}
}
示例4: mapTostr
import htsjdk.samtools.util.StringUtil; //导入方法依赖的package包/类
public String mapTostr() {
if(valList != null) return StringUtil.join(COMMA, valList);
else {
List<String> out = new ArrayList<String>();
String val;
for (String string : queryAlts) {
val = StringUtil.join(COMMA, altValMap.get(string));
if(!val.equals("")) out.add(val);
}
return StringUtil.join(COMMA, out);
}
}
示例5: toBEDHeader
import htsjdk.samtools.util.StringUtil; //导入方法依赖的package包/类
public String toBEDHeader() {
if(requiredCols == null) {
getRequiredBEDCols();
getOthersForBED();
}
String header = VCFHeader.HEADER_INDICATOR + VannoUtils.HEADER_CHR + TAB
+ VannoUtils.HEADER_FROM + TAB + VannoUtils.HEADER_TO + TAB;
if(format.refCol > 0) header += VannoUtils.HEADER_REF + TAB;
if(format.altCol > 0) header += VannoUtils.HEADER_ALT + TAB;
header += StringUtil.join(TAB, otherfields);
return header;
}
示例6: format
import htsjdk.samtools.util.StringUtil; //导入方法依赖的package包/类
private String format(List<Integer> ints) {
if (ints == null || ints.size() == 0) {
return "n/a";
}
return StringUtil.join(",", ints);
}
示例7: convertQueryToVCF
import htsjdk.samtools.util.StringUtil; //导入方法依赖的package包/类
public String convertQueryToVCF(final BedNode node) {
String h = basicCols(node, true);
if(requiredCols.get(3) != -1) h += TAB + node.allFieldsMap.get(requiredCols.get(3)); else h += TAB + ".";
if(requiredCols.get(4) != -1) h += TAB + node.allFieldsMap.get(requiredCols.get(4)); else h += TAB + ".";
if(requiredCols.get(5) != -1) h += TAB + node.allFieldsMap.get(requiredCols.get(5)); else h += TAB + ".";
if(requiredCols.get(6) != -1) h += TAB + node.allFieldsMap.get(requiredCols.get(6)); else h += TAB + ".";
h += TAB + StringUtil.join(INFO_FIELD_SEPARATOR, getOtherFieldsVal(node, true));
return h;
}
示例8: convertQueryToBED
import htsjdk.samtools.util.StringUtil; //导入方法依赖的package包/类
public String convertQueryToBED(final BedNode node) {
String h = basicCols(node, false);
if(requiredCols.get(3) != null) h += TAB + node.allFieldsMap.get(requiredCols.get(3));
if(requiredCols.get(4) != null) h += TAB + node.allFieldsMap.get(requiredCols.get(4));
h += TAB + StringUtil.join(TAB, getOtherFieldsVal(node, false));
return h;
}
示例9: toBEDHeader1
import htsjdk.samtools.util.StringUtil; //导入方法依赖的package包/类
public String toBEDHeader1() {
String header = StringUtil.join(TAB, VCFHeader.HEADER_FIELDS.values());
header = header.replace(HEADER_FIELDS.POS.toString(), VannoUtils.HEADER_FROM);
header = header.replace(HEADER_FIELDS.ID.toString(), VannoUtils.HEADER_TO);
header = header.replace(HEADER_FIELDS.INFO.toString(), StringUtil.join(TAB, infoKeys));
return header;
}
示例10: generate
import htsjdk.samtools.util.StringUtil; //导入方法依赖的package包/类
private String generate(HashMap<String, String> d) {
String[] msg = new String[headers.size()];
for(int i=0; i<msg.length; i++) {
String value = d.get(headers.get(i));
if (value == null) { value = ""; }
msg[i] = value;
}
return StringUtil.join(TAB, msg);
}
示例11: PerTileParser
import htsjdk.samtools.util.StringUtil; //导入方法依赖的package包/类
public PerTileParser(final IlluminaFileMap tilesToFiles, final int nextTile) {
this.tileToFiles = tilesToFiles;
this.currentTile = null;
this.nextTile = nextTile;
if(!tilesToFiles.containsKey(nextTile)) {
throw new IllegalArgumentException("NextTile (" + nextTile + ") is not contained by tilesToFiles (" + StringUtil.join(",", new ArrayList<Integer>(tilesToFiles.keySet())));
}
}
示例12: seekToTile
import htsjdk.samtools.util.StringUtil; //导入方法依赖的package包/类
public void seekToTile(int oneBasedTileNumber) {
nextTile = oneBasedTileNumber;
if(!tileToFiles.containsKey(oneBasedTileNumber)) {
throw new PicardException("PerTileParser does not contain key(" + oneBasedTileNumber +") keys available (" + StringUtil.join(",", new ArrayList<Integer>(tileToFiles.keySet())) + ")");
}
if(currentIterator != null) {
currentIterator.close();
}
currentIterator = null;
}
示例13: verifyData
import htsjdk.samtools.util.StringUtil; //导入方法依赖的package包/类
public void verifyData(List<Integer> tiles, final int [] cycles) {
final List<Integer> mapTiles = new ArrayList<Integer>(this.tileToFiles.keySet());
if(!mapTiles.containsAll(tiles)) {
throw new PicardException("Missing tiles in PerTileParser expected(" + StringUtil.join(",", tiles) + ") but found (" + StringUtil.join(",", mapTiles) + ")");
}
if(!tiles.containsAll(mapTiles)) {
throw new PicardException("Extra tiles where found in PerTileParser expected(" + StringUtil.join(",", tiles) + ") but found (" + StringUtil.join(",", mapTiles) + ")");
}
}
示例14: populateWritersFromMultiplexParams
import htsjdk.samtools.util.StringUtil; //导入方法依赖的package包/类
/**
* For each line in the MULTIPLEX_PARAMS file create a FastqRecordsWriter and put it in the sampleBarcodeFastqWriterMap map,
* where the key to the map is the concatenation of all sampleBarcodes in order for the given line.
*/
private void populateWritersFromMultiplexParams() {
final TabbedTextFileWithHeaderParser libraryParamsParser = new TabbedTextFileWithHeaderParser(MULTIPLEX_PARAMS);
final Set<String> expectedColumnLabels = CollectionUtil.makeSet("OUTPUT_PREFIX");
final List<String> sampleBarcodeColumnLabels = new ArrayList<>();
for (int i = 1; i <= readStructure.sampleBarcodes.length(); i++) {
sampleBarcodeColumnLabels.add("BARCODE_" + i);
}
expectedColumnLabels.addAll(sampleBarcodeColumnLabels);
assertExpectedColumns(libraryParamsParser.columnLabels(), expectedColumnLabels);
for (final TabbedTextFileWithHeaderParser.Row row : libraryParamsParser) {
List<String> sampleBarcodeValues = null;
if (!sampleBarcodeColumnLabels.isEmpty()) {
sampleBarcodeValues = new ArrayList<>();
for (final String sampleBarcodeLabel : sampleBarcodeColumnLabels) {
sampleBarcodeValues.add(row.getField(sampleBarcodeLabel));
}
}
final String key = (sampleBarcodeValues == null || sampleBarcodeValues.contains("N")) ? null : StringUtil.join("", sampleBarcodeValues);
if (sampleBarcodeFastqWriterMap.containsKey(key)) { //This will catch the case of having more than 1 line in a non-barcoded MULTIPLEX_PARAMS file
throw new PicardException("Row for barcode " + key + " appears more than once in MULTIPLEX_PARAMS file " +
MULTIPLEX_PARAMS);
}
final FastqRecordsWriter writer = buildWriter(new File(row.getField("OUTPUT_PREFIX")));
sampleBarcodeFastqWriterMap.put(key, writer);
}
if (sampleBarcodeFastqWriterMap.isEmpty()) {
throw new PicardException("MULTIPLEX_PARAMS file " + MULTIPLEX_PARAMS + " does have any data rows.");
}
libraryParamsParser.close();
}
示例15: getProbeSetName
import htsjdk.samtools.util.StringUtil; //导入方法依赖的package包/类
@Override
protected String getProbeSetName() {
if (BAIT_SET_NAME != null) {
return BAIT_SET_NAME;
} else {
final SortedSet<String> baitSetNames = new TreeSet<String>();
for (final File file : BAIT_INTERVALS) {
baitSetNames.add(CollectTargetedMetrics.renderProbeNameFromFile(file));
}
return StringUtil.join(".", baitSetNames);
}
}