private CompoundSet<NucleotideCompound> getRnaCompounds() { if (rnaCompounds != null) { return rnaCompounds; } return AmbiguityRNACompoundSet.getRNACompoundSet(); }
private CompoundSet<NucleotideCompound> getRnaCompounds() { if (rnaCompounds != null) { return rnaCompounds; } return AmbiguityRNACompoundSet.getRNACompoundSet(); }
/** * 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"; }
/** * 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"; }
if ( ! s1.getCompoundSet().equals(AmbiguityRNACompoundSet.getRNACompoundSet())) { try { s1 = new RNASequence(seq1,AmbiguityRNACompoundSet.getRNACompoundSet()); } catch (CompoundNotFoundException ex) { logger.warn("Could not align DNA and RNA compound sets: " + seq1); if( ! s2.getCompoundSet().equals(AmbiguityRNACompoundSet.getRNACompoundSet())) { try { s2 = new RNASequence(seq2,AmbiguityRNACompoundSet.getRNACompoundSet()); } catch (CompoundNotFoundException ex) { logger.warn("Could not align DNA and RNA compound sets: " + seq2);
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; }