2127 days ago
Find and replace in multifasta or fasta header with perl onliner
You have a fasta file and you want to replace: "|" You are told to replace that by "_" perl -i -p -e "s/\|/_/g" genome.fasta -i = inplace editing -p = loop over lines and print each line (after processing) -e = command line script1668 days ago
Perl script to remove duplicated lines !
#!/usr/bin/perl use strict; use warnings; { $_ = ; my $next_line; while( $next_line = ) { #print "current line: $_ -- next line: $next_line$/"...1612 days ago
Installing ggplot2 and its dependencies on Ubuntu !
...td=gnu99 option to accept ISO C89... none needed checking how to run the C preprocessor... gcc -std=gnu99 -E checking for grep that handles long lines and -e... /bin/grep checking...1602 days ago
Bash script to get exon fragments from genome files !
#Exons are already defined in the GTF file, so we simply need to print lines that are marked exonic. gunzip -c genome_file.gtf.gz | awk 'BEGIN{OFS="\t";} $3=="exon" {print $1,$4-1,$5}' | bedtools sort | bedtools merge -i - | gzip > my_exon.bed.gz1418 days ago
947 days ago
Extract all fasta sequences except ids !
...ered.fa # cat all *.rd file cat *.rd > all_reads_hits #count the lines in each file -- go in folder for FILE in *; do wc -l $FILE; done > all_hits_lines.txt880 days ago
Count number of lines in each file in Linux !
for FILE in *.rd; do wc -l $FILE; done > allReads.hits858 days ago
Bash script to find difference between two files !
#lines which are exist only in file2: grep -Fxvf file1 file2 > file3 #lines which are exist only in file1: grep -Fxvf file2 file1 > file3 #lines which are exist in both files: grep -Fxf file1 file2 > file3825 days ago
Raku script to find SSRs in fastq file !
...ile $fh.readline -> $header { $line-number++; my $sequence = $fh.readline.chomp; # Skipping the next two lines (comment and quality lines) $fh.readline;...164 days ago