public TwoBitSequenceReader(TwoBitArrayWorker<C> worker) { super(worker, new AccessionID("unknown")); }
public TwoBitSequenceReader(String sequence, CompoundSet<C> compoundSet) { this(sequence, compoundSet, new AccessionID("Unknown")); }
public FourBitSequenceReader(String sequence, CompoundSet<C> compoundSet) { this(sequence, compoundSet, new AccessionID("Unknown")); }
public FourBitSequenceReader(FourBitArrayWorker<C> worker) { super(worker, new AccessionID("unknown")); }
public TwoBitSequenceReader(String sequence, CompoundSet<C> compoundSet) { this(sequence, compoundSet, new AccessionID("Unknown")); }
public FourBitSequenceReader(String sequence, CompoundSet<C> compoundSet) { this(sequence, compoundSet, new AccessionID("Unknown")); }
public FourBitSequenceReader(FourBitArrayWorker<C> worker) { super(worker, new AccessionID("unknown")); }
public TwoBitSequenceReader(TwoBitArrayWorker<C> worker) { super(worker, new AccessionID("unknown")); }
/** * * @return */ @Override public AccessionID getAccession() { AccessionID accessionID = new AccessionID(); if (uniprotDoc == null) { return accessionID; } try { Element uniprotElement = uniprotDoc.getDocumentElement(); Element entryElement = XMLHelper.selectSingleElement(uniprotElement, "entry"); Element nameElement = XMLHelper.selectSingleElement(entryElement, "name"); accessionID = new AccessionID(nameElement.getTextContent(), DataSource.UNIPROT); } catch (XPathExpressionException e) { logger.error("Exception: ", e); } return accessionID; }
public LinkedHashMap<String, DNASequence> getDNACodingSequences() throws Exception { LinkedHashMap<String, DNASequence> dnaSequenceList = new LinkedHashMap<String, DNASequence>(); ArrayList<Element> elementList = XMLHelper.selectElements(geneidDoc.getDocumentElement(), "prediction/gene/cDNA"); logger.info("{} hits", elementList.size()); for (Element dnaElement : elementList) { Element geneElement = (Element) dnaElement.getParentNode(); String sequence = dnaElement.getTextContent().replaceAll("\\W",""); DNASequence dnaSequence = new DNASequence(sequence); String idGene = geneElement.getAttribute("idGene"); dnaSequence.setAccession(new AccessionID(idGene)); dnaSequenceList.put(idGene, dnaSequence); } return dnaSequenceList; }
public LinkedHashMap<String, ProteinSequence> getProteinSequences() throws Exception { LinkedHashMap<String, ProteinSequence> proteinSequenceList = new LinkedHashMap<String, ProteinSequence>(); ArrayList<Element> elementList = XMLHelper.selectElements(geneidDoc.getDocumentElement(), "prediction/gene/protein"); logger.info("{} hits", elementList.size()); for (Element proteinElement : elementList) { Element geneElement = (Element) proteinElement.getParentNode(); String sequence = proteinElement.getTextContent().replaceAll("\\W",""); ProteinSequence proteinSequence = new ProteinSequence(sequence); String idGene = geneElement.getAttribute("idGene"); proteinSequence.setAccession(new AccessionID(idGene)); proteinSequenceList.put(idGene, proteinSequence); } return proteinSequenceList; }
/** * Pull uniprot accessions associated with this sequence * @return * @throws XPathExpressionException */ public ArrayList<AccessionID> getAccessions() throws XPathExpressionException { ArrayList<AccessionID> accessionList = new ArrayList<AccessionID>(); if (uniprotDoc == null) { return accessionList; } Element uniprotElement = uniprotDoc.getDocumentElement(); Element entryElement = XMLHelper.selectSingleElement(uniprotElement, "entry"); ArrayList<Element> keyWordElementList = XMLHelper.selectElements(entryElement, "accession"); for (Element element : keyWordElementList) { AccessionID accessionID = new AccessionID(element.getTextContent(), DataSource.UNIPROT); accessionList.add(accessionID); } return accessionList; }
public static void main(String[] args) { try { ArrayList<GeneSequence> sequences = new ArrayList<GeneSequence>(); ChromosomeSequence seq1 = new ChromosomeSequence("ATATATATATATATATATATATATATATATATACGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCATATATATATATATATATATATACGCGCGCGCGCGCGCGCATATATATATATATATATATATATATATATATACGCGCGCGCGCGCGCGCGCGCGCGCGCGCGCATATATATATATATATATATATACGCGCGCGCGCGCGCGC"); GeneSequence gene1 = seq1.addGene(new AccessionID("gene1"), 1, 20, Strand.POSITIVE); gene1.addExon(new AccessionID("t1_1_10"), 1, 10); gene1.addExon(new AccessionID("t1_12_15"), 12, 15); GeneSequence gene2 = seq1.addGene(new AccessionID("gene2"), 1, 20, Strand.NEGATIVE); gene2.addExon(new AccessionID("t2_1_10"), 1, 10); gene2.addExon(new AccessionID("t2_12_15"), 12, 15); sequences.add(gene1); sequences.add(gene2); FastaGeneWriter fastaWriter = new FastaGeneWriter(System.out, sequences, new GenericFastaHeaderFormat<GeneSequence, NucleotideCompound>(), true); fastaWriter.process(); } catch (Exception e) { logger.warn("Exception: ", e); } } }
/** * Parse the header and set the values in the sequence * * @param header * @param sequence */ @Override public void parseHeader(String header, S sequence) { sequence.setOriginalHeader(header); String[] data = getHeaderValues(header); if (data.length == 1) { sequence.setAccession(new AccessionID(data[0])); } else { throw new RuntimeException( "No header or Some Error Occurred while reading header"); } } }
/** * Parse the header and set the values in the sequence * * @param header * @param sequence */ @Override public void parseHeader(String header, S sequence) { sequence.setOriginalHeader(header); String[] data = getHeaderValues(header); if (data.length == 1) { sequence.setAccession(new AccessionID(data[0])); } else { throw new RuntimeException( "No header or Some Error Occurred while reading header"); } } }
/** * Get the stitched together CDS sequences then maps to the cDNA * @return */ public DNASequence getDNACodingSequence() { StringBuilder sb = new StringBuilder(); for (CDSSequence cdsSequence : cdsSequenceList) { sb.append(cdsSequence.getCodingSequence()); } DNASequence dnaSequence = null; try { dnaSequence = new DNASequence(sb.toString().toUpperCase()); } catch (CompoundNotFoundException e) { // if I understand this should not happen, please correct if I'm wrong - JD 2014-10-24 logger.error("Could not create DNA coding sequence, {}. This is most likely a bug.", e.getMessage()); } dnaSequence.setAccession(new AccessionID(this.getAccession().getID())); return dnaSequence; }
/** * Parse the header and set the values in the sequence * @param header * @param sequence */ @Override public void parseHeader(String header, S sequence) { sequence.setOriginalHeader(header); sequence.setAccession(new AccessionID(accession, DataSource.GENBANK, version, identifier)); sequence.setDescription(description); sequence.setComments(comments); sequence.setReferences(references); }
/** * Parse the header and set the values in the sequence * @param header * @param sequence */ @Override public void parseHeader(String header, S sequence) { sequence.setOriginalHeader(header); sequence.setAccession(new AccessionID(accession, DataSource.GENBANK, version, identifier)); sequence.setDescription(description); sequence.setComments(comments); sequence.setReferences(references); }
/** * Get the protein sequence with user defined TranscriptEngine * @param engine * @return */ public ProteinSequence getProteinSequence(TranscriptionEngine engine) { DNASequence dnaCodingSequence = getDNACodingSequence(); RNASequence rnaCodingSequence = dnaCodingSequence.getRNASequence(engine); ProteinSequence proteinSequence = rnaCodingSequence.getProteinSequence(engine); proteinSequence.setAccession(new AccessionID(this.getAccession().getID())); return proteinSequence; }
/** * Get the protein sequence with user defined TranscriptEngine * @param engine * @return */ public ProteinSequence getProteinSequence(TranscriptionEngine engine) { DNASequence dnaCodingSequence = getDNACodingSequence(); RNASequence rnaCodingSequence = dnaCodingSequence.getRNASequence(engine); ProteinSequence proteinSequence = rnaCodingSequence.getProteinSequence(engine); proteinSequence.setAccession(new AccessionID(this.getAccession().getID())); return proteinSequence; }