Extract fasta sequences with ids in another file !
#Ids are in test.txt - one ids per line #sequences are in test.fa grep -w -A 2 -f test.txt test.fa --no-group-separator # seqtk seqtk subseq test.fa test.txt #faSomeRecods faSomeRecords in.fa listFile out.fa # seqkit seqkit grep -n -f list.txt sequences.fas > newfile2.fas901 days ago
bash script to extract sequence by ids !
Use a Perl one-liner, grep and seqtk subseq to extract the desired fasta sequences: # Create test input: cat > in.fasta BGI_...835 days ago
835 days ago
Install StringTie on ubuntu / Linux !
#StringTie is a software program to perform transcript assembly and quantification...space/bin/stringtie-1.3.0.Linux_x86_64/stringtie ~/workspace/bin/stringtie # test installation ~/workspace/bin...835 days ago
823 days ago
Commands to Find and replace in file(s0) !
#Use SED sed -i 's/my/your/g' test.txt test2.txt test3.txt #Use FIND and SED find . -name *.txt -exec sed -i 's/my/your/g' {} \; #Use AWK awk '{sub(/{OLD_TERM}/,{NEW_TERM}); print}' {file} awk '{sub(/my/,your); print}' test.txt awk '{gsub(/i/,"a"); print}' test.txt781 days ago
Raku script to find palindrome in genomes !
sub is-palindrome(Str $str) returns Bool { $str.=uc; # convert to u....flip; } sub find-palindromes(Str $dna, Int $min-length, Int $max-le...-length -> $length { for 0..^$dna.chars - $length -> $pos {...} } } # Example usage my $dna...437 days ago
Perl script for chi-squared test !
#!/usr/bin/perl # # chidi.pl # # A script to perform a chi-squared test of the dinucleotide frequenci...############################# # Perform chi-squared test ############################...423 days ago
Raku script to calculate GC content !
sub calculate-gc-content(Str $sequence) { my $gc-count = $sequence.comb(//).elems...return $gc-count / $total-bases * 100; } my $dna_sequence = "ATGCGCTAAAGCGCGCG...GCGCGCGCGC"; my $gc_content = calculate-gc-content($dna_...124 days ago
106 days ago