Command line to move all files from a directory !
find ~/Downloads/ -type f -print0 | xargs -0 mv -t ~/Videos746 days ago
745 days ago
Awk command to keep only short the fasta header !
awk '/^>/ {$0=$1} 1' file.fasta737 days ago
Perl script to read the next line of a file !
my $line = ; while(1) { # keep looping until I say so my $nextLine = ; if ($line =~ m/>/ || !defined $nextLine) { ### Do the stuff } ### Do any other stuff; last unless defined $nextLine; $line = $nextLine; }593 days ago
327 days ago
Raku script to find SSRs in fastq file !
sub find-ssrs(Str $sequence) { my @ssrs; for 2..$sequence.chars -...tq-file(Str $filename) { my $fh = open $filename, :r; my $line-number = 0; while $fh.readline -> $header { $line-n...140 days ago
Python script to convert Multi-line Fasta to Single-line Fasta
def multi_to_single_line_fasta(input_filename, output_filename):...urrent_sequence = "" for line in input_file: if line.startswith('>'):...# If a sequence line, concatenate to the current s...123 days ago
Perl script to convert Multi-line Fasta to Single-line Fasta !
#!/usr/bin/perl use strict; use w...nings; sub multi_to_single_line_fasta { my ($input_filen...uence = ""; while (my $line = ) { chomp $line;...{ # If a header line, write the previous sequence...to $output_filename in single-line FASTA format.\n"; } # Exa...123 days ago
Bash script to convert Multi-line Fasta to Single-line Fasta !
#!/bin/bash input_filename="multi_line.fasta" output_filename="single_line.fasta" awk '/^>/ {printf("\n%s\n", $0);next; } { printf("%...fully converted $input_filename to $output_filename in single-line FASTA format."123 days ago
122 days ago