Questions tagged [bash]

Use this tag to refer to the questions related to the Linux and Unix shell abbreviated as bash (Bourne Again SHell). It has notable programmatic strengths over C shell (csh) and touch C shell (tcsh)

Filter by
Sorted by
Tagged with
2 votes
3 answers
468 views

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

I have a large fasta file with DNA sequences. I need to add a ; at the end of each header line (lines beginning with >) in ...
user avatar
2 votes
1 answer
121 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 ...
user avatar
2 votes
2 answers
54 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 ...
user avatar
  • 21
2 votes
1 answer
53 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 ...
user avatar
  • 129
0 votes
0 answers
38 views

Permutation Function of 4 amino acid sequence on Bash shell

How can I write a Programming Language to construct about 160000 tetrapeptide from the 20Amino acids using permutation on Bash Shell.
user avatar
  • 1
0 votes
1 answer
2k views

curl: (22) The requested URL returned error: 400 Bad Request when using entrez direct

I've just dowloaded entrez direct on my Mac and I was trying to perform some simple queries like: ...
user avatar
1 vote
2 answers
37 views

Is there a way to calculate the Ka/Ks value in R/unix?

I am investigating the rate of synonymous non synonymous substitutions and would like to find the Ka/Ks value also known as dn and ds between multiple alleles? I want to investigate multiple alleles ...
user avatar
  • 85
2 votes
1 answer
40 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 ...
user avatar
1 vote
2 answers
192 views

Retain only part of a file name and fasta header in fasta directory

I have a MainDirectory/hundreds_of_subdirectories/thousands_of_fastas structure. For each fasta in the bottom level, I am trying to change the file name as well as ...
user avatar
  • 21
1 vote
0 answers
19 views

Nucleotide Frequency - HOMER?

I'm trying to find the frequency of UA dinucleotide in a bed file. I want to convert the bed file to FASTA, count all the UA dinucleotides up, then divide by the total length of the FASTA file. Also, ...
user avatar
0 votes
1 answer
317 views

Cellranger gives error

I am trying to run cellranger but I get fastq permission denied error ...
user avatar
  • 1,607
3 votes
2 answers
52 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 ...
user avatar
  • 31
1 vote
1 answer
69 views

how to sort and join two files based on First Column Id

I have got two files large files like this in Tab-delimited format, trying to merge in R, do we need to sort the file before merging? ...
user avatar
5 votes
3 answers
1k 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: ...
user avatar
  • 51
-1 votes
2 answers
99 views

Filter rows of VCF file for Match=EXACT?

How do I remove rows in a VCF file on 1kGenome column, where Match=EXACT using bash ?
user avatar
  • 11
0 votes
2 answers
65 views

Print specific columns in a matrix on the basis of sample id's in the header

I have a matrix file (expression.txt) in which the first column is a gene_id and from the second column the sample id's start. This matrix has 20,000 columns with sample id's corresponding to ...
user avatar
  • 125
0 votes
1 answer
461 views

STAR aligner multiple fastq files

I’m using STAR to align fastq files from SMART-seq2. I have raw data folder containing sub-folders with samples names the sub-folders each contain fastq file. How can I make a bash command in order ...
user avatar
2 votes
2 answers
166 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 ...
user avatar
1 vote
3 answers
75 views

How to filter out partially similar strings from two lists and make one list?

I have following two lists. List1 ...
user avatar
2 votes
1 answer
124 views

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

I have the following files: ...
user avatar
-1 votes
2 answers
88 views

How to remove low abundance and less prevalent data from my dataset?

I have a relative abundance table in .tsv format where samples are in column and rows contain the features (pathways). Something like this reproducible example: ...
user avatar
1 vote
0 answers
45 views

How to calculate GenePy score for vcf files in all subdirectories?

In a parent directory, I have several sub-directories, each of them contain one .vcf.gz file on which analysis should be performed. I want to run following commands on all .vcf.gz files in all ...
user avatar
  • 11
1 vote
1 answer
50 views

Table error when combining counts columns

I have these files that I want to make table of (https://github.com/learnseq/RNAseqfiles01.git), the table that I want (since all the files have the same ID column),, I want merge the ID column with ...
user avatar
1 vote
2 answers
384 views

Trying to create a .bam file without the need for a .sam file

I'm trying to use the code specified in this link to create a .bam file without the need for a .sam file. Here is the code I'm using: ...
user avatar
  • 55
2 votes
2 answers
121 views

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

I have following example data from a large file. ...
user avatar
1 vote
2 answers
221 views

Mapping statistics from bam file using bbtools and sambamba

Below are the statistics for RNA-seq mapped and unmapped paired-end reads to rice genome using reformat.sh from bbtools on bam files. It gives 77% mapped and 5% unmapped, what about the remaining 18% ...
user avatar
1 vote
2 answers
251 views

How to run Jupyter script on Slurm HPC

Now jupyter installed on the server and I am using below code to plot the rarefaction plot but I am still getting some error. could you please suggest how I can get rid of it? ...
user avatar
0 votes
1 answer
106 views

repophlan script to download bacterial genome

I am trying to donwload the microbial genome using the repophlan_get_microbes.py (https://github.com/SegataLab/repophlan) but now it is running more than 10 days and still not finished on slurm HPC. ...
user avatar
2 votes
5 answers
1k 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 ...
user avatar
  • 595
0 votes
0 answers
44 views

Issues with AutoDock Vina

I am trying to use AutoDock Vina to do docking however I am getting this error. I would really appreciate any help as I have not been able to resolve this error despite trying numerous times.
user avatar
0 votes
2 answers
114 views

Using variables with fasterq-dump?

I am trying to download multiple fastq files from the SRA NCBI database which, conveniently enough, have their IDs in a range. Building a simple loop doesn't seem to do the trick, as bash appears to ...
user avatar
  • 595
1 vote
1 answer
482 views

Split fasta file based on groups in header information and output as separate files

I have a fasta file containing the sequence of a gene across different species. In total there are around 900 samples and 12 species. (Each sequences is over multiple lines and longer than 100bp.) My ...
user avatar
  • 13
3 votes
2 answers
457 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 ...
user avatar
4 votes
1 answer
5k 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 ...
user avatar
  • 143
1 vote
4 answers
3k views

Edit FASTA header using sed

I need to rename the following headers from a FASTA file. Something like: ...
user avatar
  • 21
1 vote
1 answer
856 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 ...
user avatar
2 votes
0 answers
402 views

Cannot blast against specific NCBI databases

I am having issues with some prokaryote reference genome databases (exact names : ref_prok_rep_genomes.*), that I downloaded from the NCBI website : https://ftp.ncbi.nlm.nih.gov/blast/db/. Files in ...
user avatar
-1 votes
2 answers
71 views

Calculating the number of probes for a given genomic range

I have a big data frame like this for copy number (exome seq) ...
user avatar
  • 1,607
-3 votes
1 answer
48 views

Joinning columns from different files

I have 48 files in which I have r1 ...
user avatar
  • 1,607
1 vote
2 answers
47 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: <...
user avatar
1 vote
1 answer
43 views

Running tophat dockerfile in background

I need to use tophat2 to align some sequences, and I wish to use the docker container. These are large sequences so it will take a long time, plus I'm working on a university server so the chances of ...
user avatar
-1 votes
1 answer
38 views

Appending some columns from one tabular file to another

I have a list of files in which I have this information ...
user avatar
  • 1,607
1 vote
2 answers
60 views

Moving file based on their names

I have a list of vcf files; I also have a list of names in a txt file like LP6005409-DNA_F01 LP2000325-DNA_A01 LP6005409-DNA_E02 LP6005500-DNA_C03 What I have in ...
user avatar
  • 1,607
0 votes
2 answers
142 views

Looping over several files in bash

I have a bash script: I am wondering how I can change this script to loop over a bunch of .vcf files and give output .txt with the name of corresponding .vcf I tried changes done in similar script ...
user avatar
  • 1,607
0 votes
2 answers
136 views

Changing this code in a way to work for my files

I have a bash script which extracts some information from a .vcf file but one .vcf file at each time. How I can change this script in a way to work on a bunch of .vcf files and the output is a .txt ...
user avatar
  • 1,607
-1 votes
1 answer
65 views

bash loop for strelka2 processing for multiple files from one directory

In the below bash loop for strelka2, 3 bam files are being stored in a variable. The two questions are: Is this proper way to loop through multi bam and wait for ...
user avatar
  • 113
1 vote
1 answer
57 views

Fastq-dump script download X spots or all

Im trying to write a script where an optional input of -X flag can be used, or if that info is not available download all reads. my script as follow: ...
user avatar
0 votes
2 answers
103 views

How I can run this code on my files?

I am annotating some .txt files by Annovar software by this code nnovar]$ module load annovar/2016Feb01 [cyan01 annovar]$ table_annovar.pl But I really got ...
user avatar
2 votes
2 answers
133 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
-1 votes
1 answer
82 views

How I move these files based on their names in R or terminal

EDITED I have list of my samples in first column and corresponding file name for my .vcf files in second column of a file name clin_name.txt like below. For ...
user avatar
  • 1,607