comparison lib/CPT/Bio/SAR.pm @ 1:d724f34e671d draft default tip

planemo upload commit 94b0cd1fff0826c6db3e7dc0c91c0c5a8be8bb0c
author cpt
date Mon, 05 Jun 2023 02:50:07 +0000
parents
children
comparison
equal deleted inserted replaced
0:e4de0a0e90c8 1:d724f34e671d
1 package CPT::Bio::SAR;
2 use strict;
3 use warnings;
4 use autodie;
5 use Moose;
6
7 sub filter_sar {
8 my ($self, @seqs) = @_;
9 my @good;
10 foreach(@seqs){
11 if(has_sar_motif($_)){
12 push(@good, $_);
13 }
14 }
15 return @good;
16 }
17
18 sub has_sar_motif {
19 my ( $self, $seq ) = @_;
20
21 return 0 if(length $seq < 40);
22
23 my $reg_a = qr/([^DEKR]{3}K[^DEKR]{8,}[^DER]{1}[^DEKR]{3})/;
24 my $reg_b = qr/([KR]{1,}[^DEKR]{12,}[^DER]{1}[^DEKR]{3})/;
25
26 my $first40 = substr( $seq, 0, 40 );
27
28 # there is a transmembrane domain in the first 40 AAs
29 # there is at least one positive charged AAs in front of the TMD
30 if ( $first40 =~ $reg_a || $first40 =~ $reg_b ) {
31 my $modi1st40 = $first40;
32 # Cut out the match, and then add the whole thing to the end.
33 my $t4homology =
34 #substr($seq,0, $-[0] ), # Before the match
35 #substr($seq, $-[0], ($+[0] - $-[0])), # the match
36 substr($seq, $+[0]). # After the match
37 $first40;
38 $t4homology = substr($t4homology, 0 , 40);
39
40 if ( $t4homology =~ qr/E[A-Z]{8}[DC][A-Z]{4,5}T/ ) {
41 return 1;
42 }
43 }
44 return 0;
45 }
46
47 no Moose;
48 1;
49
50 __END__
51
52 =pod
53
54 =encoding UTF-8
55
56 =head1 NAME
57
58 CPT::Bio::SAR
59
60 =head1 VERSION
61
62 version 1.99.4
63
64 =head1 AUTHOR
65
66 Eric Rasche <rasche.eric@yandex.ru>
67
68 =head1 COPYRIGHT AND LICENSE
69
70 This software is Copyright (c) 2014 by Eric Rasche.
71
72 This is free software, licensed under:
73
74 The GNU General Public License, Version 3, June 2007
75
76 =cut