Tabnine Logo
StudyEntry.setSamplesPosition
Code IndexAdd Tabnine to your IDE (free)

How to use
setSamplesPosition
method
in
org.opencb.biodata.models.variant.StudyEntry

Best Java code snippets using org.opencb.biodata.models.variant.StudyEntry.setSamplesPosition (Showing top 16 results out of 315)

origin: org.opencb.biodata/biodata-models

public void setSamplesPosition(Map<String, Integer> samplesPosition) {
  setSamplesPosition(samplesPosition, true);
}
origin: org.opencb.biodata/biodata-models

public void setSortedSamplesPosition(LinkedHashMap<String, Integer> samplesPosition) {
  setSamplesPosition(samplesPosition, false);
}
origin: org.opencb.biodata/biodata-formats

@Override
protected void parseSplitSampleData(StudyEntry variant, VariantFileMetadata fileMetadata, String[] fields,
                  String reference, String[] alternateAlleles)
    throws NonStandardCompliantSampleField {
  // Nothing to do
  variant.setSamplesPosition(Collections.emptyMap());
}
origin: org.opencb.biodata/biodata-formats

  entry.setSamplesPosition(Collections.emptyMap());
  return;
entry.setSamplesPosition(fileMetadata.getSamplesPosition());
origin: opencb/opencga

private void fillStudyEntryFields(StudyEntry study, LinkedHashMap<String, Integer> samplesPositionToReturn, List<String> extraFields,
      List<List<String>> samplesData, boolean excludeGenotypes) {
  if (study != null) {
    //Set FORMAT
    if (extraFields.isEmpty()) {
      if (excludeGenotypes) {
        study.setFormat(Collections.emptyList());
      } else {
        study.setFormat(Collections.singletonList("GT"));
      }
    } else {
      List<String> format = new ArrayList<>(1 + extraFields.size());
      if (!excludeGenotypes) {
        format.add("GT");
      }
      format.addAll(extraFields);
      study.setFormat(format);
    }
    //Set Samples Position
    study.setSamplesPosition(samplesPositionToReturn);
    //Set Samples Data
    study.setSamplesData(samplesData);
  }
}
origin: opencb/opencga

public static Variant addGTAndFilter(Variant var, String gt, String filter) {
  StudyEntry se = var.getStudy("1");
  se.setSamplesPosition(Collections.singletonMap("1", 0));
  se.setFormat(Arrays.asList(GENOTYPE_KEY, GENOTYPE_FILTER_KEY));
  se.setSamplesData(Collections.singletonList(Arrays.asList(gt, filter)));
  return var;
}
origin: opencb/opencga

  public static Variant addGT(Variant var, String gt) {
    StudyEntry se = var.getStudy("1");
    se.addFormat("GT");
    se.getFormatPositions();
    se.setSamplesPosition(Collections.singletonMap("1", 0));
//        se.setFormat(Collections.singletonList("GT"));
    se.setSamplesData(Collections.singletonList(Collections.singletonList(gt)));
    return var;
  }

origin: org.opencb.biodata/biodata-tools

studyEntry.setSamplesPosition(samplePositions);
BiFunction<String, String, String> getSampleData = studyEntry::getSampleData;
origin: org.opencb.biodata/biodata-tools

/**
 * Create an empty Variant (position, ref, alt) from a template with basic Study information without samples.
 * @param target Variant to take as a template
 * @return Variant filled with chromosome, start, end, ref, alt, study ID and format set to GT only, BUT no samples.
 */
public Variant createFromTemplate(Variant target) {
  Variant var = new Variant(target.getChromosome(), target.getStart(), target.getEnd(), target.getReference(), target.getAlternate());
  var.setType(target.getType());
  for(StudyEntry tse : target.getStudies()){
    StudyEntry se = new StudyEntry(tse.getStudyId());
    se.setFiles(Collections.singletonList(new FileEntry("", "", new HashMap<>())));
    se.setFormat(Arrays.asList(getGtKey(), getFilterKey()));
    se.setSamplesPosition(new HashMap<>());
    se.setSamplesData(new ArrayList<>());
    var.addStudyEntry(se);
  }
  return var;
}
origin: opencb/opencga

  mainVariantNew = var;
  StudyEntry se = new StudyEntry(studyId.toString(), new LinkedList<>(), format);
  se.setSamplesPosition(new HashMap<>());
  var.addStudyEntry(se);
    variant.getStudies().get(0).setSamplesPosition(getSamplesPosition(fileId));
    variantsPerFile.get(fileId).add(variant);
    ids.addAll(variant.getIds());
    mainVariantNew.getAlternate());
StudyEntry se = new StudyEntry(studyIdStr, loadedSecondaryAlternates, format);
se.setSamplesPosition(Collections.emptyMap());
mainVariantNew.addStudyEntry(se);
origin: opencb/opencga

studyEntry.setSamplesPosition(samplePosition);
origin: opencb/opencga

variant.getStudies().get(0).setSamplesPosition(getSamplesPosition(fileId));
List<AlternateCoordinate> fileAlternates = variant.getStudies().get(0).getSecondaryAlternates();
if (!alternates.isEmpty() && !alternates.equals(fileAlternates)) {
        variant.getAlternate());
    StudyEntry studyEntry = new StudyEntry(studyIdStr, alternates, format);
    studyEntry.setSamplesPosition(Collections.emptyMap());
    templateVariant.addStudyEntry(studyEntry);
origin: opencb/opencga

se.setStudyId(vse.getStudyId());
if (null != vse.getSamplesPosition()) {
  se.setSamplesPosition(new HashMap<>(vse.getSamplesPosition()));
} else {
  se.setSamplesPosition(new HashMap<>());
origin: opencb/opencga

v1.setStudies(Collections.singletonList(se));
se.setFormat(Arrays.asList(GENOTYPE_KEY, GENOTYPE_FILTER_KEY));
se.setSamplesPosition(asMap("S1", 0));
se.setSamplesData(Collections.singletonList(Arrays.asList("1/2", "LowGQXHetDel")));
se.getSecondaryAlternates().add(new AlternateCoordinate(null, null, 328, "CTT", "CTTTC", INDEL));
se.setFiles(Collections.singletonList(new FileEntry("1", "", new HashMap<>())));
v2.setStudies(Collections.singletonList(se));
se.setSamplesPosition(asMap("S1", 0));
se.setFormat(Arrays.asList(GENOTYPE_KEY, GENOTYPE_FILTER_KEY));
se.setSamplesData(Collections.singletonList(Arrays.asList("0/1", "PASS")));
origin: org.opencb.biodata/biodata-tools

normalizedEntry.setSamplesPosition(entry.getSamplesPosition());
normalizedEntry.setFormat(entry.getFormat());
origin: org.opencb.biodata/biodata-tools

public Variant convert(VcfSliceProtos.VcfRecord vcfRecord, String chromosome, int slicePosition) {
  int start = getStart(vcfRecord, slicePosition);
  int end = getEnd(vcfRecord, slicePosition);
  Variant variant = new Variant(chromosome, start, end, vcfRecord.getReference(), vcfRecord.getAlternate());
  variant.setType(getVariantType(vcfRecord.getType()));
  variant.setIds(vcfRecord.getIdNonDefaultList());
  variant.resetLength();
  FileEntry fileEntry = new FileEntry();
  fileEntry.setFileId(fileId);
  Map<String, String> attributes = getFileAttributes(vcfRecord);
  fileEntry.setAttributes(attributes);
  fileEntry.setCall(vcfRecord.getCall().isEmpty() ? null : vcfRecord.getCall());
  if (vcfRecord.getType().equals(VariantProto.VariantType.NO_VARIATION)) {
    attributes.put("END", Integer.toString(end));
  }
  StudyEntry studyEntry = new StudyEntry(studyId);
  studyEntry.setFiles(Collections.singletonList(fileEntry));
  studyEntry.setFormat(getFormat(vcfRecord));
  studyEntry.setSamplesData(getSamplesData(vcfRecord, studyEntry.getFormatPositions()));
  studyEntry.setSamplesPosition(retrieveSamplePosition());
  studyEntry.getFormatPositions(); // Initialize the map
  List<VariantProto.AlternateCoordinate> alts = vcfRecord.getSecondaryAlternatesList();
  studyEntry.setSecondaryAlternates(getAlternateCoordinates(alts));
  variant.addStudyEntry(studyEntry);
  studyEntry.getFormatPositions(); // Initialize the map
  return variant;
}
org.opencb.biodata.models.variantStudyEntrysetSamplesPosition

Popular methods of StudyEntry

  • getSamplesData
  • getFiles
  • <init>
  • getSampleData
  • getFile
  • getStudyId
  • getOrderedSamplesName
  • getSamplesName
  • setFiles
  • setFormat
  • setSamplesData
  • getFormat
    Do not modify this list
  • setSamplesData,
  • getFormat,
  • getFormatPositions,
  • getStats,
  • setStats,
  • addSampleData,
  • getSamplesPosition,
  • getSecondaryAlternates,
  • setSecondaryAlternates

Popular in Java

  • Start an intent from android
  • getContentResolver (Context)
  • getResourceAsStream (ClassLoader)
  • onCreateOptionsMenu (Activity)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now