# HG changeset patch # User dcouvin # Date 1632242666 0 # Node ID 37d48392bf2299be50ba2cac0b945da39e76877d Uploaded diff -r 000000000000 -r 37d48392bf22 catchsequence/catchsequence.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/catchsequence/catchsequence.pl Tue Sep 21 16:44:26 2021 +0000 @@ -0,0 +1,144 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +#INPUTS_ +# my $Result_RES = $ARGV[0]; +my $sequences = $ARGV[0]; + +#OUTPUT_ +#my $output = $ARGV[1]; + +my @list_seq = split(/,/,$sequences); +#my @list_seq = @ARGV; + +my $res = 90.00; +my $plas = 90.00; +my $vf = 80.00; + +my $percentage = "ident"; # other possibility is "cov" +my $columPerc = 10; # other possibility is 9 + + + +#Other parameters +for (my $i = 0; $i <= $#ARGV; $i++) { + if ($ARGV[$i]=~/-percent/i or $ARGV[$i]=~/-perc/i) { + $percentage = $ARGV[$i+1]; + } + elsif ($ARGV[$i]=~/-res/i) { + $res = $ARGV[$i+1]; + } + elsif ($ARGV[$i]=~/-plas/i) { + $plas = $ARGV[$i+1]; + } + elsif ($ARGV[$i]=~/-vf/i) { + $vf = $ARGV[$i+1]; + } +} + +########################################################################################## + +if ($percentage eq "ident"){ + $columPerc = 10; +} +elsif ($percentage eq "cov"){ + $columPerc = 9; +} + + +#open (OUT, ">$output"); +print "Sequence\tResistance genes\tPlasmids\tVirulence genes\tST (MLST)\tAlleles (MLST)\n"; + +foreach my $sequence (@list_seq) { + my $Result_RES = `abricate --db resfinder $sequence > $sequence.RES.txt`; #appel système de la commande abricate avec la BDD ResFinder + my $Result_PLA = `abricate --db plasmidfinder $sequence > $sequence.PLA.txt`; #appel système de la commande abricate avec la BDD PlasmidFinder + my $Result_VIR = `abricate --db vfdb $sequence > $sequence.VIR.txt`; + my $Result_MLST = `mlst $sequence > $sequence.MLST.txt`; + + open (RES, "$sequence.RES.txt"); + print "$sequence\t"; + + while () { + + chomp(); + if ($_ !~ m/^#/) { + my @infos = split(/\t/,$_); + my $geneRes = $infos[5]; # resistance gene name (ancienne valeur $infos[4]) + my $identity = $infos[$columPerc]; # identity % (ancienne valeur $infos[9]) + + if ($identity > $res) { + print "$geneRes;"; + } + } + + } + + close (RES); + print "\t"; + + + open (PLA, "$sequence.PLA.txt") or die "could not open $!"; + + while () { + chomp(); + if ($_ !~ m/^#/) { + my @infos = split(/\t/,$_); + my $plasmid = $infos[5]; # plasmid name + my $identity = $infos[$columPerc]; # identity % + + if ($identity > $plas) { + print"$plasmid;"; + } + } + + } + close (PLA); + print "\t"; + + open (VIR, "$sequence.VIR.txt") or die "could not open $!"; + + while () { + chomp(); + + if ($_ !~ m/^#/) { + my @infos = split(/\t/,$_); + my $geneVir = $infos[5]; # virulence gene name + my $identity = $infos[$columPerc]; # identity % + + if ($identity > $vf) { + print "$geneVir;"; + } + } + + } + close (VIR); + print "\t"; + + + open (MLST, "$sequence.MLST.txt") or die "could not open $!"; + + while () { + chomp(); + + my @infos = split(/\t/,$_); + my $numMLST = $infos[2]; + print "$numMLST\t"; + + for (my $i=3; $i <= $#infos; $i++){ + print "$infos[$i];"; + } + + } + close (MLST); + print "\n"; +} + +#close (OUT); + +unlink glob ('*.VIR.txt'); +unlink glob ('*.PLA.txt'); +unlink glob ('*.RES.txt'); +unlink glob ('*.MLST.txt'); + diff -r 000000000000 -r 37d48392bf22 catchsequence/catchsequence.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/catchsequence/catchsequence.xml Tue Sep 21 16:44:26 2021 +0000 @@ -0,0 +1,66 @@ + + catchSequenceInfo allows to get resistance/virulence/plasmids/mlst information from DNA sequences + + abricate + mlst + + + + + "$output" + + + +]]> + + + + + + + + + + + + + + + + + + + + + + +catchSequenceInfo allows to get resistance/virulence/plasmids/mlst information from DNA sequences. + +This tool uses ABRicate (https://github.com/tseemann/abricate) and MLST (https://github.com/tseemann/mlst) programs to get dedicated information from DNA sequences (such as resistance genes, plasmid genes, virulence genes, allele IDs and MLST number). + + + + + + 10.1186/1471-2105-11-595 + 10.1093/jac/dks261 + 10.1128/AAC.02412-14 + 10.1093/nar/gkv1239 + + +