Skip to content

Instantly share code, notes, and snippets.

View nathandunn's full-sized avatar

Nathan Dunn nathandunn

View GitHub Profile
@nathandunn
nathandunn / gist:abc134d5756d2c9183c6104c534b4dcc
Created October 12, 2016 00:04
code to indentify when the 5' end is missing
if (the_mRNA.length() > 3) {
// Find the first start codon
int start_index = the_mRNA.indexOf(standard_start_codon);
while (start_index >= 0) {
String aa = getTrimmedAA(get_ORF(the_mRNA, start_index, -1),
start_index);
if (aa.length() > longest_peptide.length()) {
longest_peptide = aa;
best_start_index = start_index;
}
@nathandunn
nathandunn / gist:927c212bc23c89c8104707b2637f5206
Created October 11, 2016 17:49
old apollo setLongestORF
public void setLongestORF(Transcript transcript, SequenceUtil.TranslationTable translationTable, boolean allowPartialExtension, boolean readThroughStopCodon) {
String mrna = getSession().getResiduesWithAlterationsAndFrameshifts(transcript);
if (mrna == null || mrna.equals("null")) {
return;
}
String longestPeptide = "";
int bestStartIndex = -1;
int bestStopIndex = -1;
boolean partialStop = false;