Python script to read FASTA and FASTQ file !
# !/usr/bin/env python3 # -*- coding: utf-8 -*- from pysam import FastxFile def read_fasta_q...astxFile(fasta_q_file) as fh: for entry in fh: sequence_id = entry.name sequence...1004 days ago
Remove dupcates in multifasta file !
#Using seqkit for duplicate sequence removal seqkit rmdup -n seqs.fa -o seqs_without_duplicate.fa #Awk for duplicate sequence removal awk '/^>/ { f = !a[$0]++ } f' seqs.fa1004 days ago
Oneliner to convert lower-case to sequence masked with Ns
perl -pe '/^[^>]/ and $_=~ s/[a-z]/N/g' genomic.fna > genomic.N-masked.fna awk '{if(/^[^>]/)gsub(/[a-z]/,"N");print $0}' genomic.fna > genomic.N-masked.fna978 days ago
Perl script for Smith-Waterman Algorithm
# Smith-Waterman Algorithm # usage statement die "usage: $0 \n" unless @ARGV == 2; # get sequence...978 days ago
978 days ago
Run Pango on your multifasta file !
#More at https://cov-lineages.org/resources/pangolin/usage.html (base) [jnarayan@..._for_Cova_all_samples_combined.fa ** Running sequence QC ** Number of sequences detected: 320 Total passing...ns warnings.warn( processing block of 293 sequence...915 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_novel_T016313 Soly...t ids_gene_ids.tsv | cut -f1 > ids.selected.txt # Extract fasta sequence...851 days ago
Script to rapid genome clustering based on pairwise ANI
First, create a blast+ database: makeblastdb -in -dbtype nucl -out Next, use megabla...rom blast+ package to perform all-vs-all blastn of sequences: blastn -query -db -outfmt...pairwise ANI by combining local alignments between sequence...663 days ago
Perl script to find inverted repeats !
#!/usr/bin/perl use strict; use warnings; use Bio::SeqIO; use Bio::Tools::Run::RepeatMasker; my $genome_file = "genome.fasta"; # read genome sequence...453 days ago
Raku script to find palindrome in genomes !
sub is-palindrome(Str $str) returns Bool { $str.=uc; # convert to uppercase $str.=subst:g/\s+//; # remove...} } } # Example usage my $dna = "GGATCCATGGCCTAGG"; # example DNA sequence...452 days ago