Add basic script to check directory content against the manifests #10
Open
sarahhunt wants to merge 1 commit into
Open
Add basic script to check directory content against the manifests #10sarahhunt wants to merge 1 commit into
sarahhunt wants to merge 1 commit into
Conversation
likhitha-surapaneni
requested changes
Sep 13, 2023
| my $ftp = Net::FTP->new("ftp.1000genomes.ebi.ac.uk", Debug => 0)|| die "Cannot connect to ftp.1000genomes.ebi.ac.uk: $@"; | ||
| $ftp->login("anonymous",'-anonymous@') || die "Cannot login ", $ftp->message; | ||
|
|
||
| open my $dir_list, $ARGV[0] || die "Failed to open dir list $ARGV[0] : $!\n"; |
Collaborator
There was a problem hiding this comment.
Suggested change
| open my $dir_list, $ARGV[0] || die "Failed to open dir list $ARGV[0] : $!\n"; | |
| open my $dir_list, $ARGV[0] or die "Failed to open dir list $ARGV[0] : $!\n"; |
Interestingly, the code behaves differently for or and || when there is a file opening error. Tested with perl 5.26
| my $data_file_list = $ftp->dir(); | ||
|
|
||
| ## write list of all & download manifest | ||
| open my $out, ">", "$dir\_data_file_list" ||die "Failed to open file to write list of data files for $dir :$!\n"; |
Collaborator
There was a problem hiding this comment.
Suggested change
| open my $out, ">", "$dir\_data_file_list" ||die "Failed to open file to write list of data files for $dir :$!\n"; | |
| open my $out, ">", "$dir\_data_file_list" or die "Failed to open file to write list of data files for $dir :$!\n"; |
|
|
||
|
|
||
| ## check files in manifest available & get sizes | ||
| open my $size_log, ">$dir\_data_file_sizes" ||die "Failed to open file to write sizes of data files :$!\n"; |
Collaborator
There was a problem hiding this comment.
Suggested change
| open my $size_log, ">$dir\_data_file_sizes" ||die "Failed to open file to write sizes of data files :$!\n"; | |
| open my $size_log, ">$dir\_data_file_sizes" or die "Failed to open file to write sizes of data files :$!\n"; |
| foreach my $mani ( keys %get){ | ||
| print "starting on manifest $mani\n"; | ||
|
|
||
| open my $filelist, $mani || die "Failed to read manifest $mani :$!\n"; |
Collaborator
There was a problem hiding this comment.
Suggested change
| open my $filelist, $mani || die "Failed to read manifest $mani :$!\n"; | |
| open my $filelist, $mani or die "Failed to read manifest $mani :$!\n"; |
| $ftp->cwd("$ftp_dir/$dir") || die "Cannot change project directory to $ftp_dir/$dir ", $ftp->message; | ||
|
|
||
| ## get list of data files per dir | ||
| my $data_file_list = $ftp->dir(); |
Collaborator
There was a problem hiding this comment.
This is not giving a recursive list according to docs. Do we want to list the files recursively?
Sometimes the manifest file may not be in the root directory, we may miss the manifest file in this case unless we have a convention to have the manifest file in the root directory always.
Ex: 20220711_Strandseq
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.