Skip to content
This repository was archived by the owner on Oct 6, 2025. It is now read-only.

Conversation

@daz10000
Copy link

@daz10000 daz10000 commented May 6, 2019

This is a small extension to the amino acid representation / handling, a severely neglected corner of our basic representation, that puts the letter e.g. 'K' , symbolic Lys and trigram "Lys" forms on same footing and allows interconversion. Also pulls in some common properties and references. I keep on rewriting standalone versions of this all the time, so contributing back something more permanent

Copy link
Contributor

@chrismacklin chrismacklin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvement, will merge after tweaks.

(End, { trigram="End" ; letter = '*' ; hydrophobicity = None })
] |> Map.ofList

let aaLetterToSymbolic (aa:char) =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename as aaLetterToSymbol for consistency,

| 'Y' -> Tyr
| 'W' -> Trp
| '*' -> End
| _ -> failwithf "ERROR: unknown amino acid letter '%c' in aaLetterToSymbolic" aa
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use the Result type here instead of raising an exception?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it must be an exception, let's either use a more specific exception class or declare a custom exception type.



/// Translates amino acid represented with one character to a trigram, eg 'W' -> "Trp" , '*' -> "End"
let aaTrigramToSymbolic (aa:string) =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aaTrigramToSymbol

| "Tyr" -> Tyr
| "Trp" -> Trp
| "End" -> End
| _ -> failwithf "bad aa '%s' in aaLetterToSymbolic" aa
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Result type here as well would be nice.

@legezam
Copy link
Contributor

legezam commented May 24, 2019

Nice improvement, will merge after tweaks.

@chrismacklin , i have addressed all your comments and updated this PR. I think this PR would be easier to be merged before the migration to .net core.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants