Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #475 : Added an option to refer a folder of GFF files #476

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion bin/agat_sp_merge_annotations.pl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
use Pod::Usage;
use List::MoreUtils qw(uniq);
use AGAT::AGAT;
use File::Spec;
use File::Glob ':glob';

my $header = get_agat_header();
my $config;
Expand Down Expand Up @@ -34,6 +36,16 @@
-message => "$header\n" } );
}

my @expanded_files;
foreach my $file_or_dir (@opt_files) {
if (-d $file_or_dir) {
push @expanded_files, bsd_glob(File::Spec->catfile($file_or_dir, '*.{gff,gtf}'));
} else {
push @expanded_files, $file_or_dir;
}
}
@opt_files = @expanded_files;

if ( ! @opt_files or (@opt_files and ($#opt_files < 1) ) ){
pod2usage( {
-message => "$header\nAt least 2 files are mandatory:\n --gff file1 --gff file2\n\n",
Expand Down Expand Up @@ -101,6 +113,7 @@ =head1 DESCRIPTION
=head1 SYNOPSIS

agat_sp_merge_annotations.pl --gff infile1 --gff infile2 --out outFile
agat_sp_merge_annotations.pl --gff /path/to/folder/with/gff --out outFile
agat_sp_merge_annotations.pl --help

=head1 OPTIONS
Expand All @@ -109,7 +122,7 @@ =head1 OPTIONS

=item B<--gff> or B<-f>

Input GTF/GFF file(s). You can specify as much file you want like so: -f file1 -f file2 -f file3
Input GTF/GFF file(s). You can specify a folder containing GFF3 files with the format .gff or GTF files with .gtf format . You can also specify as much file you want like so: -f file1 -f file2 -f file3

=item B<--out>, B<--output> or B<-o>

Expand Down
Loading