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
votes
0answers
41 views

How to grep lines with a pattern from a file

I have sequencing data like this: >SRR10810922.1.1 1 length=150 ...
0
votes
1answer
55 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....
0
votes
1answer
57 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 ...
0
votes
1answer
58 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 ...
2
votes
3answers
53 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 ...
3
votes
2answers
241 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 ...
3
votes
1answer
21 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 "...
1
vote
5answers
109 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') ...
0
votes
2answers
41 views

How to parse then paste in an other file

I have a file like this A.txt (field separator = ;) : kit;;;;;;; Software Version = cti;;;;;;; Date And Time of Export = 06/02/20 14:14:11;;;;;;; Experiment Name = taqpath-AB17500-plate7587;;;;;;; ...
1
vote
2answers
69 views

Extract lines with varying location inside a file

I am trying to parse several files to extract specific lines and output them into another file. However, the location of these information within my files can change according to a specific parameter. ...
1
vote
3answers
87 views

is there is a way to extract lines in between 3 files that are in common based on one column?

I have 3 files, space separated which have about 3.4 million lines (but they don't have exactly the same number of lines and they are sorted by the "Marker" column). They look like this: head neu1 ...
1
vote
2answers
27 views

Assign sets of values from each row of a table separately to a command in bash

I have a txt file (input.txt) with 3 columns separated by \t. 62M__29_length_73210_cov_19.6684 28981-31993 minus 61M__32_length_66572_cov_22.1672 22311-25323 minus ...
-2
votes
3answers
33 views

How to create a column which has the “+” or “-” depending on the value in another column? [closed]

my data looks like this: head retinopathy.pheno.glm.logistic.hybrid1 CHROM POS ID REF ALT A1 A1_FREQ FIRTH? TEST OBS_CT BETA SE Z_STAT P ERRCODE 1 785989 1:785989:T:C C T T ...
2
votes
4answers
201 views

awk cuts strings

When I ran the below command it prints the whole string e.g. Note="Peptidase S59%2C nucleoporin" awk '$3=="mRNA"' Nitab-v4.5_gene_models_Chr_Edwards2017.gff | head Nt01 maker mRNA 143295 ...
1
vote
1answer
92 views

Using Grep to search a list and return matches

I have a short list of 1000 gene names and a full list of 20000 gene names with ID numbers. I have tried to set up a for loop to search for the shorter list in the full list to return the numbers. ...
-1
votes
1answer
41 views

How to get minor allele frequency?

I have a on my Linux machine like this:below. AF.Cases AF.Controls 0.0044 0.00159 0.0018 0.00315 0.3920 0.38898 Now I want to get the minor allele frequency (maf). So, if AF.Cases is greater than 0....
0
votes
2answers
41 views

How to append string from a file name and insert that into a column and modify?

I am creating 22 files with this following command: user@host$ awk '{ print $1, $3, $4, $5 }' chr22.gen > snps22 user@host$ awk '{ print $1, $3, $4, $5 }' chr21.gen > snps21 ... user@host$ awk '...
5
votes
3answers
302 views

AWK to replace character for lines not starting with “>”

I'm working with sequence data and I stupidly cannot find the correct way to replace "." by "X" in lines not starting with ">" using awk. I really need to use awk and not sed. I got this far, but ...
0
votes
1answer
40 views

How to replace a matching string in one file with matching string in another file?

I have a file like this: head cleandata.map 1 1:775852:T:C 0 775852 1 1:1120590:A:C 0 1120590 1 1:1145994:T:C 0 1145994 1 1:1148494:A:G 0 1148494 ... And another file: head ...
-1
votes
4answers
82 views

I want to replace texts in my file

My file looks like: NODE_13_length_50291_cov_8.067223 GTTGCCTAATATCGCCAATCCAGCTCCT NODE_25_length_22118_cov_8.258986 TATCGCCAATCCAGCTCCT NODE_36_length_15273_cov_5.283743 TGCCTAATATCGCCAATCCAG I ...
0
votes
1answer
85 views

Sorting file lines numerically by chromosome?

I have genetic variant data with several columns, currently my variants/lines are in the wrong order and need to be sorted by chromosome. I've tried a few ways to do this using answers from similar ...
0
votes
3answers
68 views

How to use awk to extract the required columns and create a new file?

I have gtf files in more than 100 directories. Below I'm showing how they look. SampleA |___________ SampleA.GRCh38.gtf SampleB |___________ SampleB.GRCh38.gtf Here I'm showing only two gtf ...
-1
votes
5answers
365 views

How to filter column in TSV file with bilions rows

I am working with a list with billions rows of data. I have data like this: Like you see, in fourth column (gene column) there exist names of genes but not all rows have a "gene name". I need to get ...
1
vote
2answers
39 views

How to know whether the column includes string?

I have a file that is something like as below. SNP Beta A1 A2 P rs124 -0.5 T C 0.11 rs534 0.22 A G 0.245 rs199 1.32 G C 0.345 rs947 -0.07 T G 0.00002 rs667 0.37 C T 0.04 .... There are 23640021 ...
-2
votes
3answers
75 views

Remove and Replace all the header sequences

kindly your comment highly appreciated have more than 4k header sequences look like: >LTR_retrotransposon100_Gypsy? cgtgcaccccaatgttcatagcagcactatttacaatagccaagacatggaaacaaccta ...
2
votes
2answers
80 views

How to select lines of file based on multiple conditions of another file?

I have 2 genetic datasets. I filter file1 based on a column in file2. However, I also need to account for a second column in file2 and I'm not sure how to do this. The condition for file 1 line ...
1
vote
1answer
42 views

How to select rows from a file based on conditions of another file?

I have 2 genetic datasets, both have a column for chromosome position. I am trying to filter file 1 based on each line's chromosome position in comparison to the chromosome positions in file 2. The ...
0
votes
1answer
67 views

How to select unique lines based on the column of another file?

I have 2 genetic datasets. File1 is a txt file and has chromosome IDs which all also appear in file 2. File 2 is a csv file and is bigger than file 1 and has more unique chromosome IDs. How can I ...
1
vote
3answers
49 views

Bash - Filter rows with a certain proportion of columns occupied

So, I've got a large number of files, each one with 8 columns and a lot of rows. Here's a head from one of them for an example. ID Ct 1 2 3 4 5 ...
6
votes
3answers
267 views

Unix fold command behaving strangely

So I have this fasta (biology) file that looks like this: >m64093_191209_130050/133911/ccs_64 TTCAGGCTGTGTTCCATTTGATTTAAAATCAAATAATTTCATTCGCGTCAGAACACCTGGTTTCACGACC ...
0
votes
6answers
160 views

How can I copy lines from multiple files into one file and name lines as the originated filename

My question is: I have 200 files in fata format. Such as: /User/Bin/bin.0.fa /User/Bin/bin.1.fa ... /User/Bin/bin.200.fa Each .fa file contains a contig name ID and nucleotide characters ...
0
votes
2answers
884 views

awk removing number after decimal

I have an input file with these fields: ENST00000456328.2 1657 1350.015 0 0 I am trying awk to remove the number after the decimal and print the rest as it is awk -F[.] '{print $1"\t"$2"\...
2
votes
3answers
181 views

How can I replace strings in a given column of a table using awk and regex?

I am studying bioinformatics, but I don't have long experience with awk and now I'm stuck. I have a table with 13 columns. In column 9 I have a lot of variations of strings like ELL1-XXXXXXXXX (e.g. ...
1
vote
2answers
105 views

Bash “Join” with two columns

I have two files: 1_file.txt: ChrX 129759713 A G ChrX 129760010 C T ChrX 129762238 C G ChrX 129762448 A G ChrX 129762803 A C ChrX 129763441 C A ChrX 129764931 T C ChrX 129767696 C T ChrX 129818213 C ...
0
votes
0answers
45 views

R packages won't install on conda R environment

I am trying to install an R package to an R environment created through conda on an HPC Server where I am doing some bioinformatics. I tried to run the usual R command (which works and install the ...
0
votes
1answer
32 views

Merging two .csv tables one with header other - not

I need to merge two .csv tables, one that contains the following info with NO HEADER: gene0 ABCD gene1 xyz gene2 1234 ..etc Another table has a header and information like that: gene_id ...
7
votes
9answers
728 views

Extract subsequence corresponding to n:th pattern from a file

I have below data blocks (multiple) chr1.trna4 (17188416-17188486) Length: 71 bp Type: Gly Anticodon: CCC at 33-35 (17188448-17188450) Score: 78.3 HMM Sc=56.60 Sec struct Sc=21.70 * ...
1
vote
2answers
390 views

Comparing two tsv files

I am trying to compare two tsv files. The file to be queried (file1) looks like: Chr Start End chr1 234738546 234738934 chr1 234792654 234793537 chr1 234908151 234908864 chr1 ...
-1
votes
2answers
135 views

Linux & Bash Chromosomes sorting files

I need to combine all the files with genomic data in that particular way. It means it should be sorted first by numbers then alphabetically. The names of files are: Homo_sapiens.GRCh38.dna.chromosome....
3
votes
5answers
171 views

Combine file data, sort on chromosome, position next to each other - column vise

I have multiple files in format: chr position value. I want to combine them in format "chr", "position", "samp1", "samp2", "samp3", "samp4",........ For example: Samp1: chr position value 1 ...
1
vote
3answers
47 views

I need to print the second line on each query in other file

I want to extract the Hit and No Hits ids from the my blast results. for example my blast output contain: > Query= TRINITY_DN109574_c0_g1_i1 Length=277 ***** No hits found ***** Lambda K ...
2
votes
1answer
61 views

bash script to find the results from multiple input files which are using 'samtools' to a new output csv file

I have query related to Bioinformatics. I have multiple bam files, from each bam file i should find out number of mapped reads from each bam file with id's, for doing it i have the command $ ...
0
votes
3answers
92 views

How to create an array of substrings

Say I have a variable, sequence, which is a string. > sequence="AAAGCATATGCTAGCCCGTATAGCGATACTAGCTATACGATATATATGATCAATGCCCGTATAG" I want to create an array, say seq, in which each element is a 3 ...
1
vote
3answers
158 views

Trying to write a script to find ORF from 6 different frames

So basically, you have a sequence, say AAAGCATATGCTAGCCCGTATAGCGATACTAGCTATACGATATATATGATCAATGCCCGTATAG You need to find all the 'ORFs' in the sequence, an ORF is any region that starts with ATG ...
0
votes
1answer
70 views

store `cat` output as a placeholder

I am using a program called minimap for aligning reads to a reference genome (computational biology problem). This program requires as input two files as positional arguments: first a reference in ....
1
vote
2answers
93 views

Loop to run a program using multiple files from different directories

So I am trying to run a program iRep and usually it runs as- iRep -f Bins/10000A-01-01_bin.* -s sam/10000A-01-01.sam.sorted.sam --sort -o 10000A-01-01_iRep_output in sam folder - 10000A-01-01.sam....
0
votes
2answers
40 views

Extracting columns from Fasta file in Linux

I have a fasta file which looks like this >ENST00000632684.1 cdna chromosome:GRCh38:7:142786213:142786224:1 gene:ENSG00000282431.1 gene_biotype:TR_D_gene transcript_biotype:TR_D_gene gene_symbol:...
0
votes
1answer
58 views

awk for column replacement

I need to replace the column 1 of file 1, with column 1 of file 2, when column 1 of file 1 matches with col 5 of file 2. file 1 ENSG00000237491 1 714150 745440 2 1 143562 ...
1
vote
5answers
130 views

Convert columns that share a match to row

I have a file with the following structure: Locus7625186 GO0004866 Locus7625186 GO0010951 Locus7625186 GO0005615 Locus7625186 GO0016021 Locus7360093 GO0004712 Locus7360093 GO0007093 Locus1507198 ...
8
votes
5answers
2k views

Removing rows containing NA in every column

I have a tab delimited file which looks like this: gene v1 v2 v3 v4 g1 NA NA NA NA g2 NA NA 2 3 g3 NA NA NA NA g4 1 2 3 2 The number of fields in every line is fixed and ...

1
2 3 4 5