Search Results

Search: Posts Made By: daashti
2,356
Posted By daashti
Does awk work in a range of columns where I can...
Does awk work in a range of columns where I can specify groups
for example: (group 1: ranging from 6-60 and group 2: from 61-100)
and my separation will be based on hetero in group 1 and homo in...
2,356
Posted By daashti
Worked like a charm. Just a question if I...
Worked like a charm.

Just a question if I want to the separation to include equal or more than 1.

Do I have to modify the code to this:
awk '
{split ("", C)
for (i=6;...
2,356
Posted By daashti
it shouldn't as the next filed has hetero. it...
it shouldn't as the next filed has hetero. it should look for all fields after the 6th column.

I am trying to create to separate files one with hetero and one with homo. if its easier to code...
2,356
Posted By daashti
lines to be printed if homo or hetero which are...
lines to be printed if homo or hetero which are field contents are constant (more than 2) across that string other than "." starting from the $6 and just the words homo and hetero

Thanks
2,356
Posted By daashti
Grep or awk a unique and specific word across many fields
Hi there,

I have data with similar structure as this:
CHR START-SNP END-SNP REF ALT PATIENT1 PATIENT2 PATIENT3 PATIENT4
chr1 69511 69511 A G homo hetero homo hetero...
5,605
Posted By daashti
Many thanks
Many thanks
5,605
Posted By daashti
Find and replace with wildcard
HI there,

I am trying to find and replace with wildcard with
data

chr1 69511 69511 A G 1/1:0,34:791,78,0:78:34 0/1:55,60:1130,0,1513:99:116 1/1:0,28:630,63,0:63:28 0/1:0,34:626,57,0:57:34
...
3,684
Posted By daashti
File size is 2 giga. I am trying to investigate...
File size is 2 giga. I am trying to investigate the original raw file in case its change.
3,684
Posted By daashti
Thanks guys for your efforts and input. I did...
Thanks guys for your efforts and input. I did convert the file using dos2unix

however still same issue. it might be an issue with the file. will investigate more.

Thanks
3,684
Posted By daashti
od output: 0000000 # C H R O M \t ...
od output:
0000000 # C H R O M \t P O S \t I D \t R E
23 43 48 52 4f 4d 09 50 4f 53 09 49 44 09 52 45
0000020 F \t A L T \t Q U ...
3,684
Posted By daashti
Hi RudiC thanks for input RudiC, i...
Hi RudiC

thanks for input RudiC,

i used
awk '{match ($0, ";SF=[^,]*,"); VAL = substr($0, RSTART+4, RLENGTH-4)} FNR == 1 || VAL > 400' file
i got no output at all apart from header

My OS...
3,684
Posted By daashti
yes i want lines/rows with SF=values larger than...
yes i want lines/rows with SF=values larger than 400
3,684
Posted By daashti
SF=are not only 3 digits its random and it goes...
SF=are not only 3 digits
its random and it goes from 0-818
e.g
SF=0,10,35,55,300,455,654
SF=754,789,790,800
3,684
Posted By daashti
I will clean the mess and put the example in a...
I will clean the mess and put the example in a better format.

Data
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT
chr1 65872 . T G 2480.51 . AC=65;AN=92;SF=0,1;VRT=1 GT:GQ:DP:AD:PL...
3,684
Posted By daashti
Thanks for your reply, real file is very similar....
Thanks for your reply, real file is very similar.
I do need the a whole line/row when filtering not only SF=values alone i.e SF values

I tried this
perl -nle '/(SF=\d+) and print $1'...
3,684
Posted By daashti
awk '{match ($0, ";SF=[^,]*,"); VAL = substr($0,...
awk '{match ($0, ";SF=[^,]*,"); VAL = substr($0, RSTART+4, RLENGTH-4)} FNR == 1 || VAL > 400' file
This didn't give the desired outcome.

and

perl -nle '/SF=(\d{3})/; print if $1 > 400 or $....
3,684
Posted By daashti
yes it is different, does that change the...
yes it is different, does that change the filtering command ?

---------- Post updated at 08:55 AM ---------- Previous update was at 08:42 AM ----------

I tried to change the column number, none...
3,684
Posted By daashti
I don't think its filtering the right way. This...
I don't think its filtering the right way. This is some of the output. it did filter rows but not sure what it did filter. e.g AC=65;AN=92;SF=0,1;VRT=1
it should be above 400...
3,684
Posted By daashti
Yes its the 10th column, corrected the typo,...
Yes its the 10th column, corrected the typo, however, the header was INFO. Will give it a try

---------- Post updated at 08:00 AM ---------- Previous update was at 07:33 AM ----------

It does...
3,684
Posted By daashti
Filtering based on column values
Hi there,

I am trying to filter a big file with several columns using values on a column with values like (AC=5;AN=10;SF=341,377,517,643,662;VRT=1). I wont to filter the data based on SF= values...
1,076
Posted By daashti
Hello there, I am not sure what exactly you...
Hello there,

I am not sure what exactly you trying to a accomplish, however, to know the duration for any task e.g to view a text file using cat use the command time before any task

time cat...
1,776
Posted By daashti
awk 'NR > 1 {for (i=1; i<=9; i++) sub (/:.*$/, _,...
awk 'NR > 1 {for (i=1; i<=9; i++) sub (/:.*$/, _, $i)} 1' OFS="\t" file:D

right?:b:

I am trying to understand the logic behind this bit. I would be grateful if you can break it down ?...
1,776
Posted By daashti
Again sorry, :( Not the Headers but the...
Again sorry, :(

Not the Headers but the entire first 9 columns is there a way to make the code work but exempt the first 9 columns (i.e i want to keep the information after the : on the the the...
1,776
Posted By daashti
Thanks Don Cragun and RudiC, I apologies for...
Thanks Don Cragun and RudiC,

I apologies for not clarifying properly, its exactly how RuiC described.
RudiC your code worked as expected, is there a way to ignore certain columns e.g #CHROM POS...
1,776
Posted By daashti
Thanks for the quick reply, I did sed...
Thanks for the quick reply,

I did
sed 's/:.*//' file.txt > file1.txt

However, this replaced only one of the columns then the rest all were empty.

Another bad idea was to cut the first 3...
Showing results 1 to 25 of 26

 
All times are GMT -4. The time now is 02:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy