Search Results

Search: Posts Made By: jianp83
875
Posted By RudiC
How come your ch1 400 line is "flanked" by the...
How come your ch1 400 line is "flanked" by the ch2 567 line? If the chromosome doesn't need to match, why then wouldn't ch3 456 flank the 400 line?

---------- Post updated at 21:30 ----------...
902
Posted By RudiC
How about awk ' FNR==NR {if ($3 > 0.7)...
How about awk '
FNR==NR {if ($3 > 0.7) EXP[$1] = EXP[$1] "," $2
next
}
{split ($1 EXP[$1], U, ",")
split ($2 EXP[$2], V,...
902
Posted By RudiC
Can't tell - even though scores below 0.7 won't...
Can't tell - even though scores below 0.7 won't be collected into awk arrays, 345 E6 records may be too many. And, I'm afraid you can't avoid three loops if you want to permute three columns.
1,381
Posted By RudiC
Try awk ' NR==FNR {a[$1] ...
Try awk '
NR==FNR {a[$1]
next
}
FNR==1
{split ($2, T, "/")}
T[1] in a
' file1 file2
col1 col2 col3
1 a/e aa
2 b/e ...
1,381
Posted By RudiC
Why don't you tell us WHAT's going wrong in lieu...
Why don't you tell us WHAT's going wrong in lieu of leaving it up to us to guess?

For the data file, NR can't be 1. User FNR instead.

---------- Post updated at 22:01 ---------- Previous update...
1,044
Posted By RudiC
Like so:awk ' {LN[$1]; HD[$2];...
Like so:awk ' {LN[$1]; HD[$2]; MX[$1,$2]++}
END { printf "%10s", ""; for (i in HD) printf "%10s", i; print "";
for (j in LN) {printf "%10s",j; ...
1,788
Posted By RudiC
Brilliant! I seem to have been a bit worn out...
Brilliant! I seem to have been a bit worn out last night...
1,788
Posted By Chubler_XL
Could I suggest these changes in red for m...
Could I suggest these changes in red for m calculation:

for (g in GN) {printf "%-40s", g
for (m in M) {
...
1,788
Posted By RudiC
Try awk 'FNR==1 {FILE++} ...
Try awk 'FNR==1 {FILE++}

FILE==1 {CHR[$1]=$2
POS[$1]=$3
next
}

FILE==2 ...
1,788
Posted By RudiC
You're not printing anything in the first awk so...
You're not printing anything in the first awk so there's nothing to pipe to the second. Even if there were, the second awk just reads file1 but not stdin from the pipe (you can use "-" to supply...
1,123
Posted By Don Cragun
If you save the following awk script in a file...
If you save the following awk script in a file named Serials.awk:
BEGIN { FS = OFS = ","
}
FNR == NR {
n[$1,++nc[$1]] = $2
next
}
FILENAME == "Serials.csv" {
nextfile
}
FNR == 1 {...
1,014
Posted By RudiC
Close. To make it really read n columns, tryawk ...
Close. To make it really read n columns, tryawk 'NR==1 {for (i=4; i<=NF; i++) READ[i]=$i
COLS=NF
next
}
...
1,014
Posted By RudiC
There's a well tested solution for converting...
There's a well tested solution for converting single column data to tables/matrices published several times in these fora; some upfront conditioning of your data and we can use that ideally:awk ...
2,054
Posted By pravin27
Could this help you ? script name - Forum1.pl ...
Could this help you ?
script name - Forum1.pl
#!/usr/bin/perl

my %hashTree;
my @array;

while (<>) {
chomp;
@array=split;
$hashTree{$array[0]}{$array[3]}=[$array[1] ,$array[2]];
}...
2,054
Posted By Don Cragun
Is you input file (other than the header line)...
Is you input file (other than the header line) always in sorted order with the Group (field 1) being the primary sort key and the Serial Number (field 4) being the secondary sort key (as in your...
1,507
Posted By ongoto
This is probably no better than what you already...
This is probably no better than what you already have, but what the heck!

#!/bin/bash

# sort -k 1,1 -k 4,4 -o infile impute.data
infil=infile
outfil=outfile
wrkfil=/tmp/impute
touch...
1,507
Posted By MadeInGermany
Another one, perhaps even more clumsy, but works...
Another one, perhaps even more clumsy, but works with any awk (but the Solaris /usr/bin/awk -> oawk)
awk '
BEGIN {OFS="\t"}
function prlast(){
f=""
if (T1=="") {
t=substr(T2,1,1)
...
1,507
Posted By RudiC
Well, this again is far from elegant, but tryawk ...
Well, this again is far from elegant, but tryawk 'function prlast( ) {
for (y in Y)
if (T[y]) {sub (T[y], "", C[LAST])
...
2,054
Posted By RudiC
Strange, complex conditions ... there might be a ...
Strange, complex conditions ... there might be a more elegant solution, but tryawk 'NR==1 {print $0, "similar to"}
NR==FNR {if ($2 !~/\*/) {L[$1,$2]=$3
...
Showing results 1 to 19 of 19

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