Created
November 8, 2013 15:57
-
-
Save yannickwurm/7373157 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def parse(signalp_hash, open_reading_frames_condensed, motif) | |
signalp_with_seq = {} | |
signalp_hash.each do |id, h| | |
current_orf = open_reading_frames_condensed[id] | |
sequence = current_orf.to_s.gsub('["', '').gsub('"]', '') | |
sp_clv = h[0][:cut_off].to_i - 1 | |
signalp = sequence[0,sp_clv] | |
seq_end = sequence[sp_clv+1, sequence.length - (sp_clv+1)] | |
if seq_end.match(/#{motif}/) | |
signalp_with_seq[id + "~- S.P. Cleavage Site: #{sp_clv}:" \ | |
"#{h[0][:cut_off]} - S.P. D-value: #{h[0][:d_value]}"] = \ | |
"#{signalp}~#{seq_end}" | |
end | |
end | |
end | |
return signalp_with_seq | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment