Questions tagged [bioinformatics]

Use this tag for questions relating to common bioinformatics tasks performed on a *nix system. Things like manipulating/converting between standard biological text formats, extracting data of interest from such formats etc.

Filter by
Sorted by
Tagged with
1 vote
4 answers
92 views

awk/sed split a cluster file in to multiple files

I have a cluster fasta file (called file) which looks like: >1AB2 >1AB2 AA NWWIEUNJRNIBGOWNGIOWGRBIGBRGRIOWGI NCIDHFR8EHGBVPIWOBGIGRI >1AB3 AA WNIOREHUEBRGOUERGHBERGIORBGREUGEGO ...
user avatar
  • 125
0 votes
1 answer
53 views

Trying to write a script to find ORF [closed]

I'm new to bash, and I found this script to identify ORF, the problem I have is that it gives me three results (ATGATGGATCCTTGCGTGCAGTAA, ATGGGATAA and ATGATGGATCCTTGCGTGCAGTAA) and not two as it ...
user avatar
1 vote
1 answer
18 views

How to install FASTQC on home space as I do not have access to the root server

I am trying to run FASTQC on some data. I am working on a server where I do not have root access. Does anyone know a way where I can install fastqc in my home space as I don't have root on the server ...
user avatar
0 votes
2 answers
61 views

How to replace the character in one column at the position indicated by another column with the string in a different column

I am rather new to bioinformatics (this is my first post!) and I would appreciate some help on task that has me stuck. I have a Tab-delimited data table with three columns: AATTCTTGCA 4 [A/T] ...
user avatar
0 votes
1 answer
25 views

Group IDs with defined range

I have a sorted file of IDs and numbers (positions). I need to group the positions in the 2nd column into intervals of 500 in a group. If the values of the row, when compared to the previous row are ...
user avatar
1 vote
5 answers
108 views

replace string x by string y according to string z

(EDITED) I have a file containing quite some problems. For example as below: Chr1_RagTag_p AUGUSTUS transcript 393571 396143 . + . transcript_id "TCONS_00000070"; gene_id "...
user avatar
  • 25
0 votes
2 answers
88 views

Grouping SNPs as locus based on defined distance

I have a sorted file of IDs and numbers (positions). I need to group the positions in the 2nd column into intervals of 500 and then split into different files. Input snp00001 200 snp00002 300 ...
user avatar
0 votes
0 answers
32 views

Using Process Substitution in docker as input <(command)

Recently, I faced some problems in developing bash pipelines with docker. This regards to the use of process substitution [<()] as input for a specific docker command. I know that this is a problem ...
user avatar
1 vote
5 answers
177 views

How can I remove the portion between the ">" and the word "Bacteria" for each occurrence in a file?

I want to remove the portion between the > and the word Bacteria for each occurrence in a file. Here is an example of the input: >AADV02000003.105686.107093 Bacteria;Cyanobacteria;...
user avatar
1 vote
2 answers
72 views

replace a string by using part of the string in the same line

I have a file like the following on a Linux machine, and the gene_id is wrong. So I would like to replace the string "PB" in the gene_id with the transcript_id from the same line. $ cat try....
user avatar
  • 25
0 votes
0 answers
10 views

StringTie ( 2.2.1) is unable to predict known transcripts

I am trying to run StringTie for hifi isoseq reads (ccs fastq reads) by first running the deSALT aligner with '--trans-strand' option (also tried minimap2 with -ax splice option) and then provide ...
user avatar
  • 77
0 votes
2 answers
35 views

What code to use to see how long Unix took to run a blastn

I have just run the following foreach: for file in *.fa do echo working on $file ! blastn -db ../lotus-date -query $file > $file.blastn echo finished $file done Is there a way to deduce how ...
user avatar
-5 votes
1 answer
59 views

I want to grep "exonic" in my ".tsv" file provided that column 13 of this file contains "p."

I want to grep exonic in my .tsv file provided that column 13 of this file contains p.. Can you help me with the code I need? Note: As there are also exonic variants with no amino acid changes, I want ...
user avatar
-1 votes
4 answers
128 views

How to remove * at the end of each protein sequence in a fasta file

I have a fasta file containing multiple sequences (amino acid sequences) of a particular protein. The last character of the sequences are denoted as "*", which actually represents the stop ...
user avatar
0 votes
5 answers
241 views

Print subset of lines from file based on column that falls within ranges of second file

I have a file with 4 columns (file1.txt): chr1 1156 G G chr1 1157 A A chr1 1165 T T chr1 1173 C C chr1 1175 G G chr1 1178 T T ...
user avatar
0 votes
0 answers
70 views

Compare the second column in file 1 and the second column in file 2 in linux

I have two files, file 1 and file 2. I want to suppose when the chromosome number are the same, if the second column in file 1 is greater than (the second column - 1,000) in file 2 and smaller than (...
user avatar
2 votes
5 answers
168 views

How can I extract some values that fall within a range

I have about 4500 lines of aminoacid variations that look like this: S1437T H1266Y T2662A E1397A E626K S1538T E3021K Briefly, the letters flanking the numbers are the amino acid residues and the ...
user avatar
1 vote
3 answers
811 views

Explanation of a sed command

I found this interesting command: grep -v '^>' test.fasta | tr -d '\n' | sed -e 's/\(.\)/\1\n/g' | sort | uniq -c | sort -rn I have some grasp what it means (it counts letters from a text file), ...
user avatar
2 votes
3 answers
206 views

using sed to capture groups

I have a file that looks like that: chr1 3143567 3143568 .3-2704 1.000000|ENSMUSG00000102693.2 chr1 3143599 3143600 .3-2705 1.000000|ENSMUSG00000102693.2 chr1 3143631 3143632 .3-2706 1.000000|...
user avatar
  • 287
-2 votes
1 answer
48 views

grep command to grep the gene list in first file present in the gff file

I am using this command to grep the gene list in first file present in the gff file. grep -w -f upregulated_genes_in_BEg GCA_900659725.1_ASM90065972v1_genomic.gff it did not work for me.. please any ...
user avatar
2 votes
1 answer
24 views

Loop through file with unique identifer and compute cumulative sum

I have a large text file, as shown below, where column1-colum3 define a region and fourth column is unique identifier. The column 6 is assigned value of the region. chr6 26204834 26204839 ...
user avatar
  • 105
0 votes
0 answers
124 views

how to remove line breaks in a (.tsv) file

I have a large square correlation matrix file (110,000 RXC) for human transcript data in .tsv format (File name = corr_trans.tsv). When I tried to extract correlation data for a transcript (say ...
user avatar
  • 67
0 votes
3 answers
188 views

how to print file name and total number of fasta sequences?

I have a fasta file namely test.fasta, pas.fasta, cel.fasta as shown below test.fasta >tile ATGTC >259 TGAT pas.fasta >ta ATGCT cel.fasta >787 TGTAG >yog TGTAT >In NNTAG I need to ...
user avatar
  • 129
1 vote
3 answers
274 views

How can I add a new element to each line of a file

I have a file with this content: CHROM_POS chr10_100009635 chr10_100187980 chr10_100229692 chr10_100267650 chr10_100269675 chr10_100279430 chr10_100285899 I want to add new content to this file like: ...
user avatar
0 votes
3 answers
52 views

extract certain substring

I have a file like this: RSID1 RSID2 chr1_169894240_G_T_b38 chr1_169894240_G_T_b38 chr1_169894240_G_T_b38 chr1_169891332_G_A_b38 chr1_169891332_G_A_b38 chr1_169891332_G_A_b38 chr1_169661963_G_A_b38 ...
user avatar
1 vote
1 answer
82 views

simulating user input in a bash script on slurm

I believe my problem is similar as found here but I was confused by the reply (and I can't comment in this question yet due to my low rep). I have a bash script I need to run using slurm, so when the ...
user avatar
0 votes
4 answers
126 views

How to separate fields in a column (into their own named columns) and then remove repeated words from each entry

I have a tsv file with 9 variables, as follows: > seqnames start endwidth strand metadata X.10logMacsq annotation distanceToTSS The metadata column contains information I want to do ...
user avatar
6 votes
5 answers
245 views

Remove all sub-fields in column-organized datafile that contain "_XX"

I have this type of file #CHROM POS ID REF ALT QUAL FILTER INFO chr1 69511 rs2691305 A G . PASS AC=70482;AN=83312;AF=0.846001;popmax=eas;...
user avatar
1 vote
2 answers
88 views

How to ignore part of a filename

Sorry if this question has been asked before. I am new to all of this. I would like to concatenate all files from different folders that contain R1 at a specific position in their filenames. My ...
user avatar
1 vote
3 answers
83 views

sed: find pattern and replace for another pattern in the same line

I have a file with gene_id and gene names in one line. I want to replace the word after gene_id with the word after gene or after product or after sprot (if some of it missed). Here is an example of a ...
user avatar
1 vote
1 answer
98 views

SED to retain part of a file name in directory

I have a MainDirectory/hundreds_of_subdirectories/thousands_of_fastas structure. For each fasta (a bioinformatics file format) in the bottom level, I am trying to change the file name as well as the ...
user avatar
  • 11
-4 votes
3 answers
188 views

Compare two DNA sequences

I have two DNA sequence ATGCATGC and TACGTTGC I want to write a program which gives "+" if upon comparing A align with T and G with C otherwise print "-" Like ATGCATGC TACGTTGC ++++...
user avatar
-1 votes
2 answers
100 views

I would like to get the names of entire headers present in another fasta file

I have a fasta file like that : >TRINITY_DN100_c0_g1_i1 len=242 path=[0:0-241] ...
user avatar
  • 1
-1 votes
4 answers
374 views

Grep for a range of numbers

I have a .txt file with multiple lines that gives amino acid and residue data. The data looks like this: ARG262-Side ASP368-Side 140,83% ARG95-Side GLU107-Side 103,73% ARG474-Side VAL468-Main 94,93% ...
user avatar
0 votes
4 answers
743 views

split a multifasta file into different files with new headers

Input file: 131751_pphA.fasta >ID:NDNDCOEC_02118 |[Genus species]|strain|PANS_1_2_annot.gbk|pphA|855|NODE_3_length_422941_cov_112.146787422941(422941):170566-171420:1 ^^ Genus species strain strain....
user avatar
  • 63
1 vote
2 answers
109 views

How to collapse consecutive numbers into ranges and get the average

I have many .txt files with the following information in 4 columns and thousands of rows: chr10 73121691 18 SLC29A3 chr10 73121692 14 SLC29A3 chr10 73121693 10 SLC29A3 chr10 73120590 15 SLC29A3 chr10 ...
user avatar
  • 51
0 votes
2 answers
131 views

Run a series of commands on a number of files

I have the following files: FC_014_6361.bam FC_014_6462.bam FC_014_6183.bam Presently I run the following commands separately on each file. For example for FC_014_6361.bam the commands are: $ ...
user avatar
  • 51
0 votes
2 answers
62 views

keep rows where range is largest [closed]

I have a file (fileA) which looks like this: >ENST00000614578.1 gene=WASP12 CDS=1-526 >ENST00000581055.1 gene=PTP2 CDS=138-579 >ENST00000577541.1 gene=PTP2 CDS=1-81 >ENST00000423485.5 gene=...
user avatar
2 votes
3 answers
197 views

extract data from file and manipulate content to write to new file

I have a csv file from which I extract data relevant to me. These are reference numbers on the one hand and genetic information in the form of the letters G, A, T and C on the other. Content csv: 1,...
user avatar
0 votes
1 answer
200 views

Comparison of N identical continuous characters from a set of two files with sequences

I have two files of each with 3 sequences (200 length each) with a header like this: #File1 >1 ...
user avatar
  • 37
0 votes
0 answers
50 views

How to modify a script for using it with more files?

I have this small script named my_script.sh #!/bin/bash size=$(infoseq -auto -nocolumns -delimiter ',' -only -noheading -length lambda_8.fa) size=$(( $size - 200 )) pos=$(($RANDOM % $size)) size2=$(( ...
user avatar
  • 37
0 votes
2 answers
106 views

How to use awk to condense columns by an ID column?

I have code I normally run in R, but the file is too big, so I am trying to run the same commands in awk. I am trying to group values in columns by an ID column (or Gene column in my case). My data ...
user avatar
  • 217
1 vote
4 answers
339 views

How to randomly extract a substring of 200 characters from a fasta file

Is there any Linux command one can use to extract a sequence from a file? For instance, a file contains one million lines, and we want to randomly sample only a sequence of 200 characters from that ...
user avatar
  • 37
0 votes
1 answer
266 views

For loop to catenate files with two variables

I am relatively new to Linux in general and I hope someone can help me. I would like to merge fastq.gz files from 4 different sequencing lanes. Each file has the following name: GC082_F4.lane1.1901.R1....
user avatar
0 votes
1 answer
117 views

Selecting one line (based on a column value) from each group of lines (based on a different column)

I have the following file: gene.14977.0.1.p2 NbD023586.1.mrna1 100.0 132 0 0 1 132 1 132 4.9e-72 268.9 gene.14977.0.1.p2 NbD032405.1.mrna1 ...
user avatar
0 votes
1 answer
67 views

How to parse then paste in the same line in awk

I have a file like this A.txt (field separator = ,) : Kit Batch Export Software Version = NO_v1 Date And Time of Export = Experiment Name = Instrument Software Version = Instrument Type = Cji ...
user avatar
  • 499
2 votes
3 answers
290 views

Count characters in line after first grep result, but removing new line from count

The problem: I have multiple text files (.fas), which look like this: file1.fas: >species1 AICGICVIAGIAIYIAAICG >species2 AICGIVVYICAGAYICAGCG file2.fas: >species1 AIG >species2 GCI I'm ...
user avatar
  • 145
3 votes
2 answers
409 views

How to display the difference between two DNA Sequences via command line tools

I have the following problem: My data sheet looks like this AAAGGGTTT AAAGGG AAAGGGCCC GGGCCC and I want to display the difference between the two sequences in the third row like this AAAGGGTTT ...
user avatar
3 votes
1 answer
58 views

How to create a new file based on results from multiple files and keep the filenames as first column?

I wanted to extract specific lines from multiple bam (a binary file format) files. I can select the lines from a single bam file using this command: samtools view -c TCGA-BH-A0BW-11A.sorted.bam "...
user avatar
  • 245
0 votes
5 answers
1k views

Looping through awk output

I have a series of strings. These are composed of smaller strings labeled as 'nodes', sometimes on their own, sometimes connected by characters : or ,. I'd like to split the larger strings ('headers') ...
user avatar
  • 177

1
2 3 4 5 6