Loading .gitignore +1 −2 Original line number Diff line number Diff line Loading @@ -3,6 +3,5 @@ build.xml manifest.mf nbproject dist/README.TXT dist/javadoc install-packages.R HDF5License.txtdeleted 100644 → 0 +0 −92 Original line number Diff line number Diff line Copyright Notice and License Terms for HDF5 (Hierarchical Data Format 5) Software Library and Utilities ----------------------------------------------------------------------------- HDF5 (Hierarchical Data Format 5) Software Library and Utilities Copyright 2006-2015 by The HDF Group. NCSA HDF5 (Hierarchical Data Format 5) Software Library and Utilities Copyright 1998-2006 by the Board of Trustees of the University of Illinois. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted for any purpose (including commercial purposes) provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions, and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions, and the following disclaimer in the documentation and/or materials provided with the distribution. 3. In addition, redistributions of modified forms of the source or binary code must carry prominent notices stating that the original code was changed and the date of the change. 4. All publications or advertising materials mentioning features or use of this software are asked, but not required, to acknowledge that it was developed by The HDF Group and by the National Center for Supercomputing Applications at the University of Illinois at Urbana-Champaign and credit the contributors. 5. Neither the name of The HDF Group, the name of the University, nor the name of any Contributor may be used to endorse or promote products derived from this software without specific prior written permission from The HDF Group, the University, or the Contributor, respectively. DISCLAIMER: THIS SOFTWARE IS PROVIDED BY THE HDF GROUP AND THE CONTRIBUTORS "AS IS" WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. In no event shall The HDF Group or the Contributors be liable for any damages suffered by the users arising out of the use of this software, even if advised of the possibility of such damage. ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- Contributors: National Center for Supercomputing Applications (NCSA) at the University of Illinois, Fortner Software, Unidata Program Center (netCDF), The Independent JPEG Group (JPEG), Jean-loup Gailly and Mark Adler (gzip), and Digital Equipment Corporation (DEC). ----------------------------------------------------------------------------- Portions of HDF5 were developed with support from the Lawrence Berkeley National Laboratory (LBNL) and the United States Department of Energy under Prime Contract No. DE-AC02-05CH11231. ----------------------------------------------------------------------------- Portions of HDF5 were developed with support from the University of California, Lawrence Livermore National Laboratory (UC LLNL). The following statement applies to those portions of the product and must be retained in any redistribution of source code, binaries, documentation, and/or accompanying materials: This work was partially produced at the University of California, Lawrence Livermore National Laboratory (UC LLNL) under contract no. W-7405-ENG-48 (Contract 48) between the U.S. Department of Energy (DOE) and The Regents of the University of California (University) for the operation of UC LLNL. DISCLAIMER: This work was prepared as an account of work sponsored by an agency of the United States Government. Neither the United States Government nor the University of California nor any of their employees, makes any warranty, express or implied, or assumes any liability or responsibility for the accuracy, completeness, or usefulness of any information, apparatus, product, or process disclosed, or represents that its use would not infringe privately- owned rights. Reference herein to any specific commercial products, process, or service by trade name, trademark, manufacturer, or otherwise, does not necessarily constitute or imply its endorsement, recommendation, or favoring by the United States Government or the University of California. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or the University of California, and shall not be used for advertising or product endorsement purposes. ----------------------------------------------------------------------------- README.md +1 −1 Original line number Diff line number Diff line  Full documentation can be found at https://documentation.tgac.ac.uk/display/NANOOK/NanoOK Full documentation can be found at http://nanook.readthedocs.io/ Contact richard.leggett@earlham.ac.uk for more information or for comments/bug reports. bin/nanook_split_fastadeleted 100755 → 0 +0 −83 Original line number Diff line number Diff line #!/usr/bin/perl # # Program: nanotools_split_fasta # Purpose: Split FASTA file into separate files for each read # Author: Richard Leggett # Contact: richard.leggett@tgac.ac.uk use strict; use warnings; use Getopt::Long; my $input_file; my $output_dir; my $help_requested; my %ids; my $count = 0; &GetOptions( 'i|input:s' => \$input_file, 'o|outputdir:s' => \$output_dir, 'h|help' => \$help_requested ); if (defined $help_requested) { print "\nnanotools_split_fasta\n\n"; print "Split a multi-read FASTA into separate files.\n\n"; print "Usage: nanotools_split_fasta.pl <-i input> [-o output_dir]\n\n"; print "Options:\n"; print " -i | -input Input FASTA file\n"; print " -o | -outputdir Output directory\n"; print "\n"; exit; } die "You must specify an input file\n" if not defined $input_file; die "You must specify an output directory\n" if not defined $output_dir; my $fh; local $| = 1; open(INPUTFILE, $input_file) or die "Can't open input ".$input_file."\n"; while(<INPUTFILE>) { my $line = $_; if ($line =~ /^>(\S+)/) { my $id = $1; if (not defined $ids{$id}) { $ids{$id} = 1; if (defined $fh) { close($fh); } my $out_filename = $output_dir."/".$id.".fasta"; $count++; #print "Writing $out_filename\n"; if (($count % 10) == 0) { print "\r$count"; } open($fh, ">".$out_filename) or die "Can't open output ".$out_filename."\n"; } else { print "WARNING: Repeat ID $id\n"; } } if (defined $fh) { print $fh $line; } else { print "Eeek\n"; } } if (defined $fh) { close($fh); } close(INPUTFILE); bin/nanook_split_reads.pl 0 → 100755 +169 −0 Original line number Diff line number Diff line #!/usr/bin/perl # # Program: nanook_split_reads # Purpose: Split FASTA/Q file into separate files for each read # Author: Richard Leggett # Contact: richard.leggett@earlham.ac.uk use strict; use warnings; use Getopt::Long; my $version="v0.02"; my $input_file; my $output_dir; my $help_requested; my %ids; my $count = 0; my $input_format; my $output_format; my $requested_output_format; my $reads_per_chunk = 4000; &GetOptions( 'f|outputfmt:s' => \$requested_output_format, 'i|input:s' => \$input_file, 'o|outputdir:s' => \$output_dir, 'h|help' => \$help_requested ); print "\nnanook_split_reads $version\n\n"; if (defined $help_requested) { print "Split a multi-read FASTA into separate files.\n\n"; print "Usage: nanook_split_reads.pl <-i input> [-o output_dir]\n\n"; print "Options:\n"; print " -i | -input Input FASTA/Q file\n"; print " -o | -outputdir Output directory\n"; print " -f | -outputfmt Output format FASTA or FASTQ\n"; print " (defaults to same as input)\n"; print "\n"; exit; } die "You must specify an input file\n" if not defined $input_file; die "You must specify an output directory\n" if not defined $output_dir; if ($input_file =~ /.fq$/i) { $input_format = "FASTQ"; } elsif ($input_file =~ /.fastq$/i) { $input_format = "FASTQ"; } elsif ($input_file =~ /.fa/i) { $input_format = "FASTA"; } elsif ($input_file =~ /.fasta$/i) { $input_format = "FASTA"; } else { die "Can't determine input file format from filename.\n"; } if (defined $requested_output_format) { $output_format = uc($requested_output_format); if ($input_format eq "FASTA") { if ($output_format ne "FASTA") { $output_format = "FASTA"; print "Defaulting to FASTA output for FASTA input\n"; } } else { if (($output_format ne "FASTA") && ($output_format ne "FASTQ")) { $output_format = $input_format; print "Unknown output format - defaulting to ".$output_format."\n"; } } } else { $output_format = $input_format; } print " Input format: $input_format\n"; print "Output format: $output_format\n"; local $| = 1; my $chunk = 0; open(INPUTFILE, $input_file) or die "Can't open input ".$input_file."\n"; while(<INPUTFILE>) { my $header_line = $_; my $sequence; my $qual_id; my $qualities; my $read_id; if (($count % $reads_per_chunk) == 0) { mkdir($output_dir."/".$chunk); } if ($input_format eq "FASTA") { if ($header_line =~ /^>(\S+)/) { $read_id = $1; } else { die "Couldn't get read ID from $header_line\n"; } $sequence = <INPUTFILE>; } else { if ($header_line =~ /^@(\S+)/) { $read_id = $1; } else { die "Couldn't get read ID from $header_line\n"; } $sequence = <INPUTFILE>; $qual_id = <INPUTFILE>; $qualities = <INPUTFILE>; } #print $header_line."\n"; if (not defined $ids{$read_id}) { $ids{$read_id} = 1; } else { print "\nWARNING: Repeat ID $read_id\n"; my $i=2; my $newid; do { $newid = $read_id."_".$i; $i++; } while (defined $ids{$newid}); print " Changed to $newid\n"; $read_id = $newid; } if ($output_format eq "FASTQ") { if ($input_format eq "FASTA") { $header_line =~ s/^>/@/; } my $out_filename = $output_dir."/".$chunk."/".$read_id.".fastq"; open(OUTFILE, ">".$out_filename) or die "Can't open output ".$out_filename."\n"; print OUTFILE $header_line; print OUTFILE $sequence; print OUTFILE $qual_id; print OUTFILE $qualities; close(OUTFILE); } else { if ($input_format eq "FASTQ") { $header_line =~ s/^@/>/; } my $out_filename = $output_dir."/".$chunk."/".$read_id.".fasta"; open(OUTFILE, ">".$out_filename) or die "Can't open output ".$out_filename."\n"; print OUTFILE $header_line; print OUTFILE $sequence; close(OUTFILE); } $count++; if (($count % $reads_per_chunk) == 0) { $chunk++; } if (($count % 10) == 0) { print "\r$count"; } } close(INPUTFILE); print "\nDone\n"; Loading
.gitignore +1 −2 Original line number Diff line number Diff line Loading @@ -3,6 +3,5 @@ build.xml manifest.mf nbproject dist/README.TXT dist/javadoc install-packages.R
HDF5License.txtdeleted 100644 → 0 +0 −92 Original line number Diff line number Diff line Copyright Notice and License Terms for HDF5 (Hierarchical Data Format 5) Software Library and Utilities ----------------------------------------------------------------------------- HDF5 (Hierarchical Data Format 5) Software Library and Utilities Copyright 2006-2015 by The HDF Group. NCSA HDF5 (Hierarchical Data Format 5) Software Library and Utilities Copyright 1998-2006 by the Board of Trustees of the University of Illinois. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted for any purpose (including commercial purposes) provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions, and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions, and the following disclaimer in the documentation and/or materials provided with the distribution. 3. In addition, redistributions of modified forms of the source or binary code must carry prominent notices stating that the original code was changed and the date of the change. 4. All publications or advertising materials mentioning features or use of this software are asked, but not required, to acknowledge that it was developed by The HDF Group and by the National Center for Supercomputing Applications at the University of Illinois at Urbana-Champaign and credit the contributors. 5. Neither the name of The HDF Group, the name of the University, nor the name of any Contributor may be used to endorse or promote products derived from this software without specific prior written permission from The HDF Group, the University, or the Contributor, respectively. DISCLAIMER: THIS SOFTWARE IS PROVIDED BY THE HDF GROUP AND THE CONTRIBUTORS "AS IS" WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. In no event shall The HDF Group or the Contributors be liable for any damages suffered by the users arising out of the use of this software, even if advised of the possibility of such damage. ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- Contributors: National Center for Supercomputing Applications (NCSA) at the University of Illinois, Fortner Software, Unidata Program Center (netCDF), The Independent JPEG Group (JPEG), Jean-loup Gailly and Mark Adler (gzip), and Digital Equipment Corporation (DEC). ----------------------------------------------------------------------------- Portions of HDF5 were developed with support from the Lawrence Berkeley National Laboratory (LBNL) and the United States Department of Energy under Prime Contract No. DE-AC02-05CH11231. ----------------------------------------------------------------------------- Portions of HDF5 were developed with support from the University of California, Lawrence Livermore National Laboratory (UC LLNL). The following statement applies to those portions of the product and must be retained in any redistribution of source code, binaries, documentation, and/or accompanying materials: This work was partially produced at the University of California, Lawrence Livermore National Laboratory (UC LLNL) under contract no. W-7405-ENG-48 (Contract 48) between the U.S. Department of Energy (DOE) and The Regents of the University of California (University) for the operation of UC LLNL. DISCLAIMER: This work was prepared as an account of work sponsored by an agency of the United States Government. Neither the United States Government nor the University of California nor any of their employees, makes any warranty, express or implied, or assumes any liability or responsibility for the accuracy, completeness, or usefulness of any information, apparatus, product, or process disclosed, or represents that its use would not infringe privately- owned rights. Reference herein to any specific commercial products, process, or service by trade name, trademark, manufacturer, or otherwise, does not necessarily constitute or imply its endorsement, recommendation, or favoring by the United States Government or the University of California. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or the University of California, and shall not be used for advertising or product endorsement purposes. -----------------------------------------------------------------------------
README.md +1 −1 Original line number Diff line number Diff line  Full documentation can be found at https://documentation.tgac.ac.uk/display/NANOOK/NanoOK Full documentation can be found at http://nanook.readthedocs.io/ Contact richard.leggett@earlham.ac.uk for more information or for comments/bug reports.
bin/nanook_split_fastadeleted 100755 → 0 +0 −83 Original line number Diff line number Diff line #!/usr/bin/perl # # Program: nanotools_split_fasta # Purpose: Split FASTA file into separate files for each read # Author: Richard Leggett # Contact: richard.leggett@tgac.ac.uk use strict; use warnings; use Getopt::Long; my $input_file; my $output_dir; my $help_requested; my %ids; my $count = 0; &GetOptions( 'i|input:s' => \$input_file, 'o|outputdir:s' => \$output_dir, 'h|help' => \$help_requested ); if (defined $help_requested) { print "\nnanotools_split_fasta\n\n"; print "Split a multi-read FASTA into separate files.\n\n"; print "Usage: nanotools_split_fasta.pl <-i input> [-o output_dir]\n\n"; print "Options:\n"; print " -i | -input Input FASTA file\n"; print " -o | -outputdir Output directory\n"; print "\n"; exit; } die "You must specify an input file\n" if not defined $input_file; die "You must specify an output directory\n" if not defined $output_dir; my $fh; local $| = 1; open(INPUTFILE, $input_file) or die "Can't open input ".$input_file."\n"; while(<INPUTFILE>) { my $line = $_; if ($line =~ /^>(\S+)/) { my $id = $1; if (not defined $ids{$id}) { $ids{$id} = 1; if (defined $fh) { close($fh); } my $out_filename = $output_dir."/".$id.".fasta"; $count++; #print "Writing $out_filename\n"; if (($count % 10) == 0) { print "\r$count"; } open($fh, ">".$out_filename) or die "Can't open output ".$out_filename."\n"; } else { print "WARNING: Repeat ID $id\n"; } } if (defined $fh) { print $fh $line; } else { print "Eeek\n"; } } if (defined $fh) { close($fh); } close(INPUTFILE);
bin/nanook_split_reads.pl 0 → 100755 +169 −0 Original line number Diff line number Diff line #!/usr/bin/perl # # Program: nanook_split_reads # Purpose: Split FASTA/Q file into separate files for each read # Author: Richard Leggett # Contact: richard.leggett@earlham.ac.uk use strict; use warnings; use Getopt::Long; my $version="v0.02"; my $input_file; my $output_dir; my $help_requested; my %ids; my $count = 0; my $input_format; my $output_format; my $requested_output_format; my $reads_per_chunk = 4000; &GetOptions( 'f|outputfmt:s' => \$requested_output_format, 'i|input:s' => \$input_file, 'o|outputdir:s' => \$output_dir, 'h|help' => \$help_requested ); print "\nnanook_split_reads $version\n\n"; if (defined $help_requested) { print "Split a multi-read FASTA into separate files.\n\n"; print "Usage: nanook_split_reads.pl <-i input> [-o output_dir]\n\n"; print "Options:\n"; print " -i | -input Input FASTA/Q file\n"; print " -o | -outputdir Output directory\n"; print " -f | -outputfmt Output format FASTA or FASTQ\n"; print " (defaults to same as input)\n"; print "\n"; exit; } die "You must specify an input file\n" if not defined $input_file; die "You must specify an output directory\n" if not defined $output_dir; if ($input_file =~ /.fq$/i) { $input_format = "FASTQ"; } elsif ($input_file =~ /.fastq$/i) { $input_format = "FASTQ"; } elsif ($input_file =~ /.fa/i) { $input_format = "FASTA"; } elsif ($input_file =~ /.fasta$/i) { $input_format = "FASTA"; } else { die "Can't determine input file format from filename.\n"; } if (defined $requested_output_format) { $output_format = uc($requested_output_format); if ($input_format eq "FASTA") { if ($output_format ne "FASTA") { $output_format = "FASTA"; print "Defaulting to FASTA output for FASTA input\n"; } } else { if (($output_format ne "FASTA") && ($output_format ne "FASTQ")) { $output_format = $input_format; print "Unknown output format - defaulting to ".$output_format."\n"; } } } else { $output_format = $input_format; } print " Input format: $input_format\n"; print "Output format: $output_format\n"; local $| = 1; my $chunk = 0; open(INPUTFILE, $input_file) or die "Can't open input ".$input_file."\n"; while(<INPUTFILE>) { my $header_line = $_; my $sequence; my $qual_id; my $qualities; my $read_id; if (($count % $reads_per_chunk) == 0) { mkdir($output_dir."/".$chunk); } if ($input_format eq "FASTA") { if ($header_line =~ /^>(\S+)/) { $read_id = $1; } else { die "Couldn't get read ID from $header_line\n"; } $sequence = <INPUTFILE>; } else { if ($header_line =~ /^@(\S+)/) { $read_id = $1; } else { die "Couldn't get read ID from $header_line\n"; } $sequence = <INPUTFILE>; $qual_id = <INPUTFILE>; $qualities = <INPUTFILE>; } #print $header_line."\n"; if (not defined $ids{$read_id}) { $ids{$read_id} = 1; } else { print "\nWARNING: Repeat ID $read_id\n"; my $i=2; my $newid; do { $newid = $read_id."_".$i; $i++; } while (defined $ids{$newid}); print " Changed to $newid\n"; $read_id = $newid; } if ($output_format eq "FASTQ") { if ($input_format eq "FASTA") { $header_line =~ s/^>/@/; } my $out_filename = $output_dir."/".$chunk."/".$read_id.".fastq"; open(OUTFILE, ">".$out_filename) or die "Can't open output ".$out_filename."\n"; print OUTFILE $header_line; print OUTFILE $sequence; print OUTFILE $qual_id; print OUTFILE $qualities; close(OUTFILE); } else { if ($input_format eq "FASTQ") { $header_line =~ s/^@/>/; } my $out_filename = $output_dir."/".$chunk."/".$read_id.".fasta"; open(OUTFILE, ">".$out_filename) or die "Can't open output ".$out_filename."\n"; print OUTFILE $header_line; print OUTFILE $sequence; close(OUTFILE); } $count++; if (($count % $reads_per_chunk) == 0) { $chunk++; } if (($count % 10) == 0) { print "\r$count"; } } close(INPUTFILE); print "\nDone\n";