Questions tagged [bash]

Use this tag to refer to the questions related to the Linux and Unix shell abbreviated as bash (Bourne Again SHell).

Filter by
Sorted by
Tagged with
14 votes
3 answers
7k views

What is a quick way to find the reverse complement in bash

I have a DNA sequence for which I would like to quickly find the reverse complement. Is there a quick way of doing this on the bash command line using only GNU tools?
winni2k's user avatar
  • 2,256
7 votes
4 answers
9k views

Bash scripting FastQC for multiple fastq files in multiple directories

I am completely new to bioinformatics so I'm looking to learn how to do this. I have multiple directories with fastq files: E.g; 10 Directories with each time series, each with Treatment and control ...
user avatar
6 votes
2 answers
6k views

Sort vcf by contig and position within contig

Due to tabix constraints, I need to sort a vcf so that contigs and then positions within contigs occur in numerical order in the vcf. I don't know if the following will sort positions within contigs, ...
Peter Pearman's user avatar
5 votes
3 answers
2k views

Removing duplicate FASTA sequences based on headers with Bash

I used the following command to remove duplicate FASTA sequences based on the header sequence: ...
aman's user avatar
  • 51
5 votes
2 answers
10k views

Calculating average coverage for .bam files (sequence data)

(Full discolosure that this is my first time working with sequence data, and with the bash scripting.) I need to calculate the average coverage for any .bam file. After some searching I wrote the ...
Mirte's user avatar
  • 153
5 votes
2 answers
3k views

BAM to gene expression matrix (UMI counts per gene per cell),10X

I am trying to reproduce some results of a scRNASeq experiment. However I am new to the server-side aspect of such analyses and am very confused at the moment. The data provided by the authors of the ...
h3ab74's user avatar
  • 836
5 votes
4 answers
488 views

How to rename a file based on a directory name?

I have a lot of FASTA files that I recently scaffolded with RagTag. The output of RagTag includes a directory for each sample and the corresponding FASTA file written as "ragtag.scaffold.fasta&...
rimo's user avatar
  • 963
4 votes
2 answers
469 views

How to align output of grep --color=always? (To QC fasta/fastq files)

Grepping out short sequences from a fasta or fastq file is a really useful way to look at sequencing data. Using the option --color=always makes this even more ...
conchoecia's user avatar
  • 3,141
4 votes
2 answers
195 views

How can I give different names to files in a directory with a for loop in a bash script?

I'm expecting to get 17 different paired-end fastq files (34 in total), so I want to make a bash script to just run my code through all the fastq files in a directory at once. How can I change the ...
Pablo O. García Díaz's user avatar
4 votes
1 answer
2k views

Error given while trying to index a BAM file with Samtools Index - NO COOR?

I am currently working on my own Metagenomic pipeline, utilizing Bowtie 2 to map. Bowtie 2 outputs a SAM file, which I convert to a .BAM and sort it using Samtools. When I try to utilize Samtools to ...
user avatar
4 votes
0 answers
128 views

Write a bash script to run gatk, fix errors with input, and rerun until completion

I have a bam file that I want to run through GATK's SplitNCigarReads tool. Because of the way the bam file was generated, the program will often fail, with an error message stating: ...
kylep's user avatar
  • 41
3 votes
4 answers
934 views

How can I add a ";" at the end of each fasta header line in a file?

I have a large fasta file with RNA sequences. I need to add a ; at the end of each header line (lines beginning with >) in ...
Callahan McGovern's user avatar
3 votes
2 answers
21k views

How to merge .fastq.qz files into a single .fastq.gz with their same id without losing any content in parallel

I have a large number of .fastq.gz files of different lane and reads. I have to merge them each reads group files into single .fastq.gz files. **eg: 1st type NA24694_GCCAAT_L001_R1_001.fastq.gz ...
Nitha's user avatar
  • 73
3 votes
3 answers
295 views

Easier / lazy way to convert an existing bash pipeline to nextflow pipeline?

Not going to lie, my head hurts when I read the NextFlow documentation (No dig on the documentation, I think my head is losing its processing capacity lol). I had written a pipeline in Bash, ...
Karthik Nair's user avatar
3 votes
2 answers
60 views

Calling for one specific SNP from multiple sequencing runs

Just learning the basics of bioinformatics and bash shell scripting. Is there a correct way to search for a specific allele with one or even multiple sequencing runs? I am searching for prevalence of ...
S.J.A's user avatar
  • 31
3 votes
1 answer
116 views

How to remove double '/' from file path, bash script

I'm using the following script to detect strandedness of my paired end RNA-seq data. ...
pubsurfted's user avatar
3 votes
2 answers
403 views

Remote blastn - what is breaking my (bash) loop?

I am trying to search the NCBI non-redundant database for sequences similar to a few other (~40) sequences that I already have. So I've tried running blastn remotely, and looping through multiple ...
Laura's user avatar
  • 909
3 votes
1 answer
44 views

Passing strings for password, email authentication and download link

Hi I am downloading the data from a website which requires authentication of email_id and password before the download. They then provide the download link which is used to download dataset. This ...
Priya's user avatar
  • 351
3 votes
2 answers
1k views

How to subset genes and its nested features from a GFF file using a gene list

I would like to subset a GFF file (gene and nested features) from a gene list. The GFF file looks like this ...
Felipe Almeida's user avatar
3 votes
3 answers
145 views

How to get the product of a CDS

I need the name of the protein in /product="protein_name" using bash commands. Beware, there is a lot of whitespace between lines. ...
Aron van Beelen's user avatar
3 votes
2 answers
115 views

Printing the results of for loop into a txt file

I have a for loop which prints available vcf files in the path for a list of patient IDs (using find dx data function) into my zsh terminal: ...
Zizogolu's user avatar
  • 2,132
3 votes
1 answer
275 views

Run nextflow pipeline multiple times depending on length of a list

This question was also asked on Stack Overflow I have a Nextflow pipeline that runs a BUSCO search on input data, returns the output and then creates a report based on the output. One of my parameters ...
CornOnTheCob's user avatar
3 votes
2 answers
87 views

bash script for interproscan REST

hey i have the problem with bash script. It should run interproscan REST Im green in bash scripting. I found this script on the web: ...
MTG's user avatar
  • 147
3 votes
1 answer
2k views

Running htseq-count over BAM files

I am trying to derive an expression matrix from BAM files using htseq-count. These are bulk RNASeq BAM's by the way. I have read the ...
h3ab74's user avatar
  • 836
3 votes
2 answers
623 views

How to remove sequences from a fasta file using a sequence ID list which contains a space within the id?

I have a fasta file that contains sequence reads and sequence id file that needed to be removed from the fasta file. I have done this earlier, but since id contains a space my piece of code is not ...
MudithMMBc's user avatar
2 votes
2 answers
138 views

How to get rows with similar values in two different columns using command line?

I have following example data from a large file. ...
MudithMMBc's user avatar
2 votes
4 answers
610 views

Parallelize or qsub a bash script

I have a bash script that I would like to parellelize to run on multiple nodes. My goal is to run my python sample_script.py script on pairwise comparisons of samples to see if their variants are a ...
che625's user avatar
  • 21
2 votes
6 answers
3k views

How to measure the total size of a fastq file in base pairs?

Or Kbps/Gbps. It feels like it should be conceptually very simple, but I can't seem to figure out the right combination of keywords to find it via my search engine. Help would be appreciated! I have ...
Laura's user avatar
  • 909
2 votes
3 answers
325 views

MiXCR: only create a single export file for all clonotypes

I am using following command from MiXCR to both align, assemble and export my input files: ...
Jan's user avatar
  • 43
2 votes
3 answers
171 views

Replace lowercase characters with -

I have an output from vcfutils.pl vcf2fq with specified minimal depth, and it means that nucleotides with not enough depth are lowercase. I would like to change them to gaps. I could do it in higher ...
robinj's user avatar
  • 123
2 votes
2 answers
169 views

How can I run a command for multiple files?

I have a bunch of .vcf files in a folder and I want to run command below on all of them but doing that one by one manually is really painful. I am seeking for a way ...
user avatar
2 votes
2 answers
862 views

how to remove range from fasta header

Could you please suggest me how I can remove range from fasta header:like these number from below sequences which has some colons indicating the range of the genome :147010-147657 :149201-149845 <...
bioinfonext's user avatar
2 votes
2 answers
2k views

Error with BWA Mem input having multiple fastq files using cat and process substitution

Running BWA Mem on a number of paired end fastq files using process substitution on the inputs results in this error: ...
111's user avatar
  • 195
2 votes
1 answer
103 views

Manta "--exome: command not found"

I am using Manta (https://github.com/Illumina/manta/blob/master/docs/userGuide/README.md) but whenever I try to specify the --exome command using the following code ...
Indira's user avatar
  • 380
2 votes
2 answers
726 views

How to wget a gff from NCBI database?

Say I want to use wget to download a gff file for the X chromosome of release 5.57 of the Drosophila melanogaster genome. The NCBI page with the gff file for just this is here. However, I do not see ...
arara's user avatar
  • 152
2 votes
2 answers
53 views

Trying to divide number in fourth TSV column by a certain number according to its corresponding identifier in the first column

I was wondering if anyone could help with my little issue in manipulating tsv files in order to calculate estimated coverage across many tsv files. I have tsv files that look something like this: <...
Stanley Ho's user avatar
2 votes
1 answer
74 views

Pattern mining from a genomic sequence

I need to find the following pattern from a genomic sequence ...
Kumar's user avatar
  • 109
2 votes
1 answer
109 views

Analysis of RNA sequencing with zUMIs

I wrote the .yaml file which was according the instruction from zUMIs: ...
Isidora Pantovic's user avatar
2 votes
1 answer
778 views

How do I use bash for loops to loop through a WDL Array?

Within the example below a WDL array of strings, test is defined as "a","b","c","d" the ...
Logios James's user avatar
2 votes
1 answer
400 views

How to edit the headers of multiple fasta files from multiple folders?

My directories are organized as follows: one main directory, in which I have multiple directories that end with a number ranging from 314 to 727, followed by .3 . For example, 'mgm4761314.3'. Within ...
Laura's user avatar
  • 909
2 votes
1 answer
97 views

Dealing With Manta Limitations

I am trying to figure out a way to remove the limiting factors that Manta says it cannot handle. To quote from the Manta page: The following limitations exist on the input BAM or CRAM files provided ...
Indira's user avatar
  • 380
2 votes
1 answer
82 views

Default placeholder for missing fields doesn't work with block in xtract tool

I am using the xtract tool of the Entrez Direct (EDirect) package of NBCI. I have a list of Accession Numbers: ...
Rossy Clair's user avatar
2 votes
2 answers
149 views

Mapping to assemblies in subdirectories

I am performing a bash loop one liner:. for k in */Assembly/*/*.fastq; do minimap2 -ax map-ont assembly.fasta $k > mapping.sam; echo $k; done The file hierarchy ...
matt's user avatar
  • 21
2 votes
1 answer
607 views

Merging several fq.gz files or R1 and R2 classes into a single one

I have the following files: ...
Juan Pablo Aguilar Cabezas's user avatar
2 votes
1 answer
1k views

remove sequences from fasta file matching a string in the header

I have a file with 16S sequences. some headers contain species information. For my purposes I would like to exclude a number of species from the file, therefore I would like to do a pattern matching ...
Irrussional's user avatar
2 votes
2 answers
550 views

Filter reads belonging to unique sequences with threshold

I have CLL samples as fastq files and I want to remove those reads which have a unique sequence with less than 10 read counts each. I tried this by following way using awk to make it faster: ...
Lot_to_learn's user avatar
2 votes
1 answer
88 views

CNV Kit ` from . import commands ImportError: cannot import name 'commands' from '__main__'`

I am trying to run some code for my colleague in bash ...
Indira's user avatar
  • 380
2 votes
1 answer
248 views

Python argparse error

Hi I am trying to use this python script (running with bash script) to do my analysis. I am getting the following error: File "my_python_script.py", line 33 logging.info("Reading input2 ...
Riya's user avatar
  • 307
2 votes
1 answer
43 views

Automatize classical debugging in a bash script? (normal debugging by hand)

And thanks in advance. I am debugging a text file which is the one the two inputs on the program RGmatch https://bitbucket.org/pfurio/rgmatch/src/master/. The code works. Is that some records give ...
Edmond Geraud Aguilar's user avatar
2 votes
0 answers
40 views

Racon: empty overlap set!

Not sure if anyone can help me with a Racon issue as the developers are not very responsive on GitHub. I am trying to assemble a genome without a reference. I first did basecalling using dorado, then ...
Setshaba's user avatar