Skip to content

Commit

Permalink
fix #507 - add option raw to print raw data in a dedidcated folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Juke34 committed Dec 4, 2024
1 parent 4ca5e04 commit e7f0180
Show file tree
Hide file tree
Showing 4 changed files with 207 additions and 121 deletions.
32 changes: 28 additions & 4 deletions bin/agat_sp_statistics.pl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
my $opt_percentile = 90;
my $opt_genomeSize = undef;
my $opt_plot = undef;
my $opt_raw = undef;
my $opt_verbose = 0;
my $opt_help= 0;

Expand All @@ -25,8 +26,9 @@
"h|help" => \$opt_help,
'o|output=s' => \$opt_output,
'percentile=i' => \$opt_percentile,
'yaml!' => \$opt_yaml,
'd|p' => \$opt_plot,
'yaml!' => \$opt_yaml,
'r|raw!' => \$opt_raw,
'd|p!' => \$opt_plot,
'v|verbose' => \$opt_verbose,
'g|f|gs=s' => \$opt_genomeSize,
"gff|i=s" => \$gff))
Expand Down Expand Up @@ -62,6 +64,23 @@
}
}

# Manage raw data
if($opt_raw){
if ($opt_output){
$opt_raw = $opt_output."_raw_data";
}
else{
$opt_raw = "raw_data";

if (-f $opt_raw){
print "Cannot create a directory with the name $opt_raw because a file with this name already exists.\n";exit();
}
if (-d $opt_raw){
print "Cannot create a directory with the name $opt_raw because a folder with this name already exists.\n";exit();
}
}
}

#Manage plot folder output
if($opt_plot){

Expand Down Expand Up @@ -107,6 +126,7 @@
percentile => $opt_percentile,
output => $out,
yaml => $opt_yaml,
raw => $opt_raw,
distri => $opt_plot,
isoform => 1,
verbose => $opt_verbose
Expand Down Expand Up @@ -150,7 +170,7 @@ =head1 OPTIONS
=item B<-d> or B<-p>
When this option is used, an histogram of distribution of the features will be printed in pdf files. (d means distribution, p means plot).
Bolean - When this option is used, an histogram of distribution of the features will be printed in pdf files in a folder with distribution_plots suffix. (d means distribution, p means plot).
=item B<-v> or B<--verbose>
Expand All @@ -164,9 +184,13 @@ =head1 OPTIONS
Integer - Percentile to compute. Default is 90.
=item B<-r> or B<--raw>
Bolean - When this option is used, the raw data (same as used to create histogram of distribution of the features) are printed in a dedicated folder with raw_data suffix.
=item B<--yaml>
Bolean - When this option is activated , a second output will be printed either in STDOUT if no output provided or in <output.yaml> (a .yaml suffix is added to the --output value provided)
Bolean - When this option is activated, a second output will be printed either in STDOUT if no output provided or in <output.yaml> (a .yaml suffix is added to the --output value provided).
=item B<-c> or B<--config>
Expand Down
8 changes: 6 additions & 2 deletions docs/tools/agat_sp_statistics.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ agat_sp_statistics.pl --help

- **-d** or **-p**

When this option is used, an histogram of distribution of the features will be printed in pdf files. (d means distribution, p means plot).
Bolean - When this option is used, an histogram of distribution of the features will be printed in pdf files in a folder with distribution_plots suffix. (d means distribution, p means plot).

- **-v** or **--verbose**

Expand All @@ -43,9 +43,13 @@ agat_sp_statistics.pl --help

Integer - Percentile to compute. Default is 90.

- **-r** or **--raw**

Bolean - When this option is used, the raw data (same as used to create histogram of distribution of the features) are printed in a dedicated folder with raw_data suffix.

- **--yaml**

Bolean - When this option is activated , a second output will be printed either in STDOUT if no output provided or in <output.yaml> (a .yaml suffix is added to the --output value provided)
Bolean - When this option is activated, a second output will be printed either in STDOUT if no output provided or in <output.yaml> (a .yaml suffix is added to the --output value provided).

- **-c** or **--config**

Expand Down
Loading

0 comments on commit e7f0180

Please sign in to comment.