5 votes
Accepted

Using SED command in Nextflow script

Inside your script's command string, assembly_id is actually a java.lang.String so trying to manipulate it with a Bash operation (i.e. using ...
Steve's user avatar
  • 3,079
5 votes

How to get a file with the number of reads for several fastq.gz files?

One way would be to use seqkit stats, which can be installed using conda: ...
Steve's user avatar
  • 3,079
5 votes
Accepted

Keeping DNA sequence after changing FASTA header on command line

The grep, cut, sed pipeline could also be replaced with the following awk command: ...
Steve's user avatar
  • 3,079
3 votes

Analysis of RNA sequencing with zUMIs

I'd advise you to keep away from ZUMIs unless you're doing the same workflow that it was designed for. I spent many days trying to sort out issues with that program, and eventually gave up; it wasn't ...
gringer's user avatar
  • 13.9k
3 votes

How to run a GATK Docker Image with local files?

Read the manual please: https://docs.docker.com/storage/bind-mounts/ -v or --volume: Consists of three fields, separated by ...
Ram RS's user avatar
  • 2,279
3 votes

Keeping DNA sequence after changing FASTA header on command line

The problem is in the grep command you're using, which only sends the fasta file headers to the output. Here's my guess at what the commands in your pipeline do: <...
gringer's user avatar
  • 13.9k
3 votes
Accepted

How can I change all text in a .tsv file to 1, except the first three fields?

Not an expert, but : awk 'BEGIN { FS = OFS = "\t" } { for(i=4; i<=6; i++) if($i ~ /^ *$/) {$i = 0} else {$i = 1} }; 1' Since you have a very specific ...
Sam's user avatar
  • 149
3 votes
Accepted

Residue numbering in biopython

@M__ is right - there's a molecule_type error when you try to write and this needs to be fixed. Here's my end to end approach: The input file: ...
Ram RS's user avatar
  • 2,279
3 votes

How to rename a file based on a directory name?

Assuming the output is only a list of directories and each directory includes a file called "ragtag.scaffold.fasta", you could use brace expansion to generate the SOURCE and DEST strings: <...
Steve's user avatar
  • 3,079
3 votes
Accepted

How to rename a file based on a directory name?

Just execute the following immediately above the directories of interest, (post edited to include OPs "constant term") ...
M__'s user avatar
  • 12.1k
3 votes
Accepted

Filtering file with AWK and writing output to new file

The {} isn't in any way special to the shell or awk. It is used as a replacement by certain other programs, off the top of my ...
terdon's user avatar
  • 9,846
3 votes

How to remove empty files from a directory?

Always Google before asking on forums. I googled "delete empty files linux" and this was the second result: https://www.baeldung.com/linux/delete-empty-files-dirs ...
Ram RS's user avatar
  • 2,279
2 votes
Accepted

How to remove empty files from a directory?

This isn't the most efficient approach, using find will be easier and faster as long as your find supports the ...
terdon's user avatar
  • 9,846
2 votes

How to remove empty files from a directory?

As already stated, one way is to use the GNU find (the default on Linux) command. This will find and print all empty files in the current directory: ...
Steve's user avatar
  • 3,079
2 votes

Combine separate fasta files from a list.txt

This should work xargs < names.txt cat > names.fasta Or else try, cat names.txt | xargs cat > newdir/names.fasta What ...
M__'s user avatar
  • 12.1k
1 vote

How can I limit blast results to exclude a specific taxonomic ID?

This isn't particularly elegant, but it should work. First, extract the accessions into a file. Next, get the taxid for each of the accessions. Once you have that, you can identify the accessions that ...
terdon's user avatar
  • 9,846
1 vote

what does 8 stands for in bwa mem command line

When you have questions on software then the first thing is to do your due diligence and read the manual: https://bio-bwa.sourceforge.net/bwa.shtml Then simply checking for the "-t" argument ...
ATpoint's user avatar
  • 1,137
1 vote

Combine separate fasta files from a list.txt

Just to address an edge case, run dos2unix names.txt first and then a modified version of @M__'s command ...
Ram RS's user avatar
  • 2,279
1 vote

How can I identify the virulence factors in my FASTQ files generated from nanopore sequencing bacteria DNA?

you could try to submit your sequences to VFDB: a reference database for bacterial virulence factors ; paper here : reference paper. use the VFanalyzer tool VFanalyzer provides an automatic analysis ...
pippo1980's user avatar
  • 1,043
1 vote

How to get a file with the number of reads for several fastq.gz files?

You can replace gunzip -c with zcat. ...
Supertech's user avatar
  • 596
1 vote

How to remove empty files from a directory?

@Ram RS has identified the solution here via find, if that does not work then the following will work, ...
M__'s user avatar
  • 12.1k
1 vote

How to rename a file based on a directory name?

Perl one-liner: ls */filename | perl -lane 'print "mv $1/$3 $1/$2_$3" if /(\S+_([^\/_\s]+))\/(\S+)/'
user172818's user avatar
  • 6,525
1 vote

How to rename a file based on a directory name?

If you want to use Perl: ...
Supertech's user avatar
  • 596

Only top scored, non community-wiki answers of a minimum length are eligible