comparison lib/CPT/Bio/GFF_Parsing.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::GFF_Parsing;
2 use Moose;
3 use autodie;
4
5 my $tags = 'allele anticodon artificial_location
6 bio_material bound_moiety cell_line cell_type chromosome citation
7 clone clone_lib codon_start collected_by collection_date compare
8 country cultivar culture_collection db_xref dev_stage direction
9 EC_number ecotype environmental_sample estimated_length exception
10 experiment focus frequency function gap_type gene gene_synonym
11 germline haplogroup haplotype host identified_by inference isolate
12 isolation_source lab_host lat_lon linkage_evidence locus_tag
13 macronuclear map mating_type mobile_element_type mod_base mol_type
14 ncRNA_class note number old_locus_tag operon organelle organism
15 partial PCR_conditions PCR_primers phenotype plasmid pop_variant
16 product protein_id proviral pseudo rearranged replace
17 ribosomal_slippage rpt_family rpt_type rpt_unit_range rpt_unit_seq
18 satellite segment serotype serovar sex specimen_voucher
19 standard_name strain sub_clone sub_species sub_strain tag_peptide
20 tissue_lib tissue_type transgenic translation transl_except
21 transl_table trans_splicing variety';
22 my %valid_tags = map { $_ => 1 } split( /\s+/, $tags );
23
24 my $keys = "-10_signal -35_signal 3'UTR 5'UTR
25 CAAT_signal CDS C_region D-loop D_segment GC_signal J_segment LTR
26 N_region RBS STS S_region TATA_signal V_region V_segment
27 assembly_gap attenuator enhancer exon gap gene iDNA intron mRNA
28 mat_peptide misc_RNA misc_binding misc_difference misc_feature
29 misc_recomb misc_signal misc_structure mobile_element
30 modified_base ncRNA old_sequence operon oriT polyA_signal
31 polyA_site precursor_RNA prim_transcript primer_bind promoter
32 protein_bind rRNA rep_origin repeat_region sig_peptide source
33 stem_loop tRNA terminator tmRNA transit_peptide unsure variation";
34 my %valid_keys = map { $_ => 1 } split( /\s+/, $keys );
35
36 has 'tag_conv' => ( is => 'ro', isa => 'HashRef', default => sub { return {
37 #tags
38 'dbxref' => 'db_xref',
39 'parent' => 'note',
40 'name' => 'label',
41 'Name' => 'label',
42 'old-name' => 'obsolete_name',
43 'id' => 'note',
44 'nat-host' => 'host',
45 'genome' => 'note',
46 'region' => 'source',
47 }; });
48
49
50 sub fix_gff_tag {
51 my ($self, $tag) = @_;
52 # Lowercase it
53 if(defined $tag && defined(${$self->tag_conv()}{lc($tag)})){
54 return ${$self->tag_conv()}{lc($tag)};
55 }
56 return $tag;
57 }
58
59
60 no Moose;
61 1;
62
63 __END__
64
65 =pod
66
67 =encoding UTF-8
68
69 =head1 NAME
70
71 CPT::Bio::GFF_Parsing
72
73 =head1 VERSION
74
75 version 1.99.4
76
77 =head1 AUTHOR
78
79 Eric Rasche <rasche.eric@yandex.ru>
80
81 =head1 COPYRIGHT AND LICENSE
82
83 This software is Copyright (c) 2014 by Eric Rasche.
84
85 This is free software, licensed under:
86
87 The GNU General Public License, Version 3, June 2007
88
89 =cut