Skip to content

Instantly share code, notes, and snippets.

@nathandunn
Created October 12, 2016 00:04
Show Gist options
  • Save nathandunn/abc134d5756d2c9183c6104c534b4dcc to your computer and use it in GitHub Desktop.
Save nathandunn/abc134d5756d2c9183c6104c534b4dcc to your computer and use it in GitHub Desktop.
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;
}
start_index = the_mRNA.indexOf(standard_start_codon, start_index + 1);
}
/* just in case the 5 prime end is missing see if
a longer translation can be obtained without looking
for the ATG */
start_index = 0;
while (start_index < 3) {
String orf = get_ORF(the_mRNA, start_index, -1);
String aa = getTrimmedAA(orf, start_index);
if (aa.length() > longest_peptide.length()) {
setMissing5prime(true);
longest_peptide = aa;
best_start_index = start_index;
}
start_index++;
}
}
if (best_start_index >= 0) {
@nathandunn
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment