We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9b325f2 commit 40f4af1Copy full SHA for 40f4af1
etc/reapply_species_strain_map.pl
@@ -102,8 +102,29 @@ BEGIN
102
$gene->update();
103
}
104
105
+
106
+ # Remove unused organisms
107
+ $organism_rs = $curs_schema->resultset('Organism');
108
109
+ while (defined (my $organism = $organism_rs->next())) {
110
+ if ($organism->genes()->count() == 0 &&
111
+ $organism->genotypes()->count() == 0) {
112
+ my $strain_rs = $organism->strains();
113
114
+ while (defined (my $strain = $strain_rs->next())) {
115
+ if ($strain->genotypes()->count() == 0) {
116
+ $strain->delete();
117
+ }
118
119
120
+ if ($strain_rs->count() == 0) {
121
+ $organism->delete();
122
123
124
125
};
126
127
128
my $load_util = Canto::Track::LoadUtil->new(schema => $schema);
129
130
0 commit comments