Tabnine Logo
AmbiguityDNACompoundSet.getDNACompoundSet
Code IndexAdd Tabnine to your IDE (free)

How to use
getDNACompoundSet
method
in
org.biojava.nbio.core.sequence.compound.AmbiguityDNACompoundSet

Best Java code snippets using org.biojava.nbio.core.sequence.compound.AmbiguityDNACompoundSet.getDNACompoundSet (Showing top 12 results out of 315)

origin: biojava/biojava

private CompoundSet<NucleotideCompound> getDnaCompounds() {
  if (dnaCompounds != null) {
    return dnaCompounds;
  }
  return AmbiguityDNACompoundSet.getDNACompoundSet();
}
origin: org.biojava/biojava-core

private CompoundSet<NucleotideCompound> getDnaCompounds() {
  if (dnaCompounds != null) {
    return dnaCompounds;
  }
  return AmbiguityDNACompoundSet.getDNACompoundSet();
}
origin: biojava/biojava

private static SubstitutionMatrix<NucleotideCompound> getNucleotideMatrix(String file) {
  if (!nucleotideMatrices.containsKey(file)) {
    nucleotideMatrices.put(file, new SimpleSubstitutionMatrix<NucleotideCompound>(
        AmbiguityDNACompoundSet.getDNACompoundSet(), getReader(file), file));
  }
  return nucleotideMatrices.get(file);
}
origin: org.biojava/biojava-core

private static SubstitutionMatrix<NucleotideCompound> getNucleotideMatrix(String file) {
  if (!nucleotideMatrices.containsKey(file)) {
    nucleotideMatrices.put(file, new SimpleSubstitutionMatrix<NucleotideCompound>(
        AmbiguityDNACompoundSet.getDNACompoundSet(), getReader(file), file));
  }
  return nucleotideMatrices.get(file);
}
origin: biojava/biojava

private DNASequence getRawParentSequence(String accessId) throws IOException {
  String seqUrlTemplate = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nuccore&id=%s&rettype=fasta&retmode=text";
  URL url = new URL(String.format(seqUrlTemplate, accessId));
  logger.trace("Getting parent DNA sequence from URL: {}", url.toString());
  InputStream is = url.openConnection().getInputStream();
  FastaReader<DNASequence, NucleotideCompound> parentReader
      = new FastaReader<DNASequence, NucleotideCompound>(is,
          new PlainFastaHeaderParser<DNASequence, NucleotideCompound>(),
          new DNASequenceCreator(AmbiguityDNACompoundSet.getDNACompoundSet()));
  LinkedHashMap<String, DNASequence> seq = parentReader.process();
  DNASequence parentSeq = null;
  if (seq.size() == 1) {
    parentSeq = seq.values().iterator().next();
  }
  is.close();
  return parentSeq;
}
origin: org.biojava/biojava-core

private DNASequence getRawParentSequence(String accessId) throws IOException {
  String seqUrlTemplate = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=nuccore&id=%s&rettype=fasta&retmode=text";
  URL url = new URL(String.format(seqUrlTemplate, accessId));
  logger.trace("Getting parent DNA sequence from URL: {}", url.toString());
  InputStream is = url.openConnection().getInputStream();
  FastaReader<DNASequence, NucleotideCompound> parentReader
      = new FastaReader<DNASequence, NucleotideCompound>(is,
          new PlainFastaHeaderParser<DNASequence, NucleotideCompound>(),
          new DNASequenceCreator(AmbiguityDNACompoundSet.getDNACompoundSet()));
  LinkedHashMap<String, DNASequence> seq = parentReader.process();
  DNASequence parentSeq = null;
  if (seq.size() == 1) {
    parentSeq = seq.values().iterator().next();
  }
  is.close();
  return parentSeq;
}
origin: biojava/biojava

/**
 * Determines GCG type
 * @param cs compound set of sequences
 * @return GCG type
 */
public static <C extends Compound> String getGCGType(CompoundSet<C> cs) {
  return (cs == DNACompoundSet.getDNACompoundSet() || cs == AmbiguityDNACompoundSet.getDNACompoundSet()) ? "D" :
    (cs == RNACompoundSet.getRNACompoundSet() || cs == AmbiguityRNACompoundSet.getRNACompoundSet()) ? "R" : "P";
}
origin: org.biojava/biojava-core

/**
 * Determines GCG type
 * @param cs compound set of sequences
 * @return GCG type
 */
public static <C extends Compound> String getGCGType(CompoundSet<C> cs) {
  return (cs == DNACompoundSet.getDNACompoundSet() || cs == AmbiguityDNACompoundSet.getDNACompoundSet()) ? "D" :
    (cs == RNACompoundSet.getRNACompoundSet() || cs == AmbiguityRNACompoundSet.getRNACompoundSet()) ? "R" : "P";
}
origin: biojava/biojava

private Sequence<NucleotideCompound> getNucleotideSequence(String seq) {
  Sequence<NucleotideCompound> s = null;
  // first we try DNA, then RNA, them hybrid
  try {
    s = new DNASequence(seq, AmbiguityDNACompoundSet.getDNACompoundSet());
  } catch (CompoundNotFoundException e){
    try {
      s= new RNASequence(seq, AmbiguityRNACompoundSet.getRNACompoundSet());
    } catch (CompoundNotFoundException ex) {
      try {
        // it could still be a hybrid, e.g. 3hoz, chain T, what to do in that case?
        s = new DNASequence(seq, AmbiguityDNARNAHybridCompoundSet.getDNARNAHybridCompoundSet());
        logger.warn("Hybrid RNA/DNA sequence detected for sequence {}", seq);
      } catch (CompoundNotFoundException exc) {
        // not DNA, nor RNA, nor hybrid
        logger.warn("Could not determine compound set (neither DNA, RNA nor hybrid) for nucleotide sequence " + seq);
        return null;
      }
    }
  }
  return s;
}
origin: org.opencb.biodata/biodata-tools

private SequencePair<DNASequence, NucleotideCompound> getPairwiseAlignment(String seq1, String seq2) {
  DNASequence target = null;
  DNASequence query = null;
  try {
    target = new DNASequence(seq1, AmbiguityDNACompoundSet.getDNACompoundSet());
    query = new DNASequence(seq2, AmbiguityDNACompoundSet.getDNACompoundSet());
  } catch (CompoundNotFoundException e) {
    String msg = "Error when creating DNASequence objects for " + seq1 + " and " + seq2 + " prior to pairwise "
        + "sequence alignment";
    logger.error(msg, e);
    throw new VariantNormalizerException(msg, e);
  }
  SubstitutionMatrix<NucleotideCompound> substitutionMatrix = SubstitutionMatrixHelper.getNuc4_4();
  SimpleGapPenalty gapP = new SimpleGapPenalty();
  gapP.setOpenPenalty((short)5);
  gapP.setExtensionPenalty((short)2);
  SequencePair<DNASequence, NucleotideCompound> psa = Alignments.getPairwiseAlignment(query, target,
      Alignments.PairwiseSequenceAlignerType.GLOBAL, gapP, substitutionMatrix);
  return psa;
}
origin: biojava/biojava

  subMatrix = temp;
} else if (cs == AmbiguityDNACompoundSet.getDNACompoundSet()) {
  @SuppressWarnings("unchecked") // compound types must be equal since compound sets are equal
  SubstitutionMatrix<C> temp = (SubstitutionMatrix<C>) SubstitutionMatrixHelper.getNuc4_4();
origin: org.biojava/biojava-alignment

  subMatrix = temp;
} else if (cs == AmbiguityDNACompoundSet.getDNACompoundSet()) {
  @SuppressWarnings("unchecked") // compound types must be equal since compound sets are equal
  SubstitutionMatrix<C> temp = (SubstitutionMatrix<C>) SubstitutionMatrixHelper.getNuc4_4();
org.biojava.nbio.core.sequence.compoundAmbiguityDNACompoundSetgetDNACompoundSet

Popular methods of AmbiguityDNACompoundSet

  • addNucleotideCompound
  • calculateIndirectAmbiguities

Popular in Java

  • Finding current android device location
  • onRequestPermissionsResult (Fragment)
  • getSupportFragmentManager (FragmentActivity)
  • addToBackStack (FragmentTransaction)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • JCheckBox (javax.swing)
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Top Sublime Text plugins
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