/** * Fairly important constructor given the size of a ChromsomeSequence where the * ProxySequenceReader could load from disk via RandomAccessFile so that the sequence * doesn't need to be kept in memory. Could also be a NCBI proxy to load sequence * data as needed from remote web server. * @param proxyLoader */ public ChromosomeSequence(SequenceReader<NucleotideCompound> proxyLoader) { super(proxyLoader, DNACompoundSet.getDNACompoundSet()); }
/** * String is king and assume DNA * @param seqString * @throws CompoundNotFoundException */ public ChromosomeSequence(String seqString) throws CompoundNotFoundException { super(seqString, DNACompoundSet.getDNACompoundSet()); }
/** * String is king and assume DNA * @param seqString * @throws CompoundNotFoundException */ public ChromosomeSequence(String seqString) throws CompoundNotFoundException { super(seqString, DNACompoundSet.getDNACompoundSet()); }
/** * String is king and create a sequence from DNA with default DNA compound set * @param seqString * @throws CompoundNotFoundException */ public DNASequence(String seqString) throws CompoundNotFoundException { super(seqString, DNACompoundSet.getDNACompoundSet()); }
/** * Create a sequence where the actual storage of the sequence data is somewhere else * @param proxyLoader */ public DNASequence(SequenceReader<NucleotideCompound> proxyLoader) { super(proxyLoader, DNACompoundSet.getDNACompoundSet()); }
/** * String is king and create a sequence from DNA with default DNA compound set * @param seqString * @throws CompoundNotFoundException */ public DNASequence(String seqString) throws CompoundNotFoundException { super(seqString, DNACompoundSet.getDNACompoundSet()); }
/** * Create a sequence where the actual storage of the sequence data is somewhere else * @param proxyLoader */ public DNASequence(SequenceReader<NucleotideCompound> proxyLoader) { super(proxyLoader, DNACompoundSet.getDNACompoundSet()); }
/** * Fairly important constructor given the size of a ChromsomeSequence where the * ProxySequenceReader could load from disk via RandomAccessFile so that the sequence * doesn't need to be kept in memory. Could also be a NCBI proxy to load sequence * data as needed from remote web server. * @param proxyLoader */ public ChromosomeSequence(SequenceReader<NucleotideCompound> proxyLoader) { super(proxyLoader, DNACompoundSet.getDNACompoundSet()); }
private Sequence getSequence(String gappedSequenceString){ if (gappedSequenceString == null) return null; Sequence returnSeq = null; String sequenceString = gappedSequenceString.replace("-", ""); try { if (sequenceString.matches("^[ACTG]+$")) returnSeq = new DNASequence(sequenceString, DNACompoundSet.getDNACompoundSet()); else if (sequenceString.matches("^[ACUG]+$")) returnSeq = new RNASequence(sequenceString, DNACompoundSet.getDNACompoundSet()); else returnSeq = new ProteinSequence(sequenceString, AminoAcidCompoundSet.getAminoAcidCompoundSet()); } catch (CompoundNotFoundException ex) { logger.error("Unexpected error, could not find compound when creating Sequence object from Hsp", ex); } return returnSeq; }
private Sequence getSequence(String gappedSequenceString){ if (gappedSequenceString == null) return null; Sequence returnSeq = null; String sequenceString = gappedSequenceString.replace("-", ""); try { if (sequenceString.matches("^[ACTG]+$")) returnSeq = new DNASequence(sequenceString, DNACompoundSet.getDNACompoundSet()); else if (sequenceString.matches("^[ACUG]+$")) returnSeq = new RNASequence(sequenceString, DNACompoundSet.getDNACompoundSet()); else returnSeq = new ProteinSequence(sequenceString, AminoAcidCompoundSet.getAminoAcidCompoundSet()); } catch (CompoundNotFoundException ex) { logger.error("Unexpected error, could not find compound when creating Sequence object from Hsp", ex); } return returnSeq; }
/** * 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"; }
public static void main(String[] args) throws Exception { DNASequence dnaSequence = new DNASequence("ATCG"); logger.info("DNA Sequence: {}", dnaSequence.toString()); StringProxySequenceReader<NucleotideCompound> sequenceStringProxyLoader = new StringProxySequenceReader<NucleotideCompound>("GCTA", DNACompoundSet.getDNACompoundSet()); DNASequence dnaSequenceFromProxy = new DNASequence(sequenceStringProxyLoader); logger.info("DNA Sequence from Proxy: {}", dnaSequenceFromProxy.toString()); } }
public static void main(String[] args) throws Exception { DNASequence dnaSequence = new DNASequence("ATCG"); logger.info("DNA Sequence: {}", dnaSequence.toString()); StringProxySequenceReader<NucleotideCompound> sequenceStringProxyLoader = new StringProxySequenceReader<NucleotideCompound>("GCTA", DNACompoundSet.getDNACompoundSet()); DNASequence dnaSequenceFromProxy = new DNASequence(sequenceStringProxyLoader); logger.info("DNA Sequence from Proxy: {}", dnaSequenceFromProxy.toString()); } }
/** * 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"; }
/** * * @param parentSequence * @param bioBegin * @param bioEnd * @param phase */ public CDSSequence(TranscriptSequence parentSequence, int bioBegin, int bioEnd, int phase) { parentTranscriptSequence = parentSequence; this.setParentSequence(parentTranscriptSequence); setBioBegin(bioBegin); setBioEnd(bioEnd); this.phase = phase; this.setCompoundSet(DNACompoundSet.getDNACompoundSet()); }
/** * * @param parentDNASequence * @param begin * @param end inclusive of end */ public TranscriptSequence(GeneSequence parentDNASequence, int begin, int end) { setParentSequence(parentDNASequence); this.parentGeneSequence = parentDNASequence; setBioBegin(begin); setBioEnd(end); this.setCompoundSet(DNACompoundSet.getDNACompoundSet()); }
/** * * @param parentDNASequence * @param begin * @param end inclusive of end */ public TranscriptSequence(GeneSequence parentDNASequence, int begin, int end) { setParentSequence(parentDNASequence); this.parentGeneSequence = parentDNASequence; setBioBegin(begin); setBioEnd(end); this.setCompoundSet(DNACompoundSet.getDNACompoundSet()); }
/** * * @param parentSequence * @param bioBegin * @param bioEnd * @param phase */ public CDSSequence(TranscriptSequence parentSequence, int bioBegin, int bioEnd, int phase) { parentTranscriptSequence = parentSequence; this.setParentSequence(parentTranscriptSequence); setBioBegin(bioBegin); setBioEnd(bioEnd); this.phase = phase; this.setCompoundSet(DNACompoundSet.getDNACompoundSet()); }
/** * Read a Genbank DNA sequence * @param inStream * @return * @throws Exception */ public static LinkedHashMap<String, DNASequence> readGenbankDNASequence( InputStream inStream) throws Exception { GenbankReader<DNASequence, NucleotideCompound> GenbankReader = new GenbankReader<DNASequence, NucleotideCompound>( inStream, new GenericGenbankHeaderParser<DNASequence, NucleotideCompound>(), new DNASequenceCreator(DNACompoundSet.getDNACompoundSet())); return GenbankReader.process(); }
/** * Read a fasta DNA sequence * @param inStream * @return * @throws IOException */ public static LinkedHashMap<String, DNASequence> readFastaDNASequence( InputStream inStream) throws IOException { FastaReader<DNASequence, NucleotideCompound> fastaReader = new FastaReader<DNASequence, NucleotideCompound>( inStream, new GenericFastaHeaderParser<DNASequence, NucleotideCompound>(), new DNASequenceCreator(DNACompoundSet.getDNACompoundSet())); return fastaReader.process(); }