Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Eliminating entries based on relative values Post 302817213 by Xterra on Wednesday 5th of June 2013 11:46:57 AM
Old 06-05-2013
Hey bartus!

Good to hear from you! Thanks for your prompt reply. I tried your script but I do not get the expected output. This is what I am getting:
Code:
$ awk -F, 'NR==FNR&&$3<1{a[">"$2]=1}NR!=FNR&&!($0 in a)&&/^>/{print;getline;print}' dista.txt seq.txt
>Sample1 Freq 59
ggatatgatgatgaactggt
>Sample1 Freq 54
ggatatgatgttgaactggt
>Sample1 Freq 44
ggatatgttgatgaactggt
>Sample1 Freq 39
ggatttgatgatgaactggt
>Sample1 Freq 3a 39
ggatatgatgatgaactggt
>Sample2 Freq 38
ggatatgatgatgaactggt
>Sample2 run13 reversed 7 3a Freq 32
ggatttgatgatgaactggt
>Sample2 run13 reversed 8 3a 30
ggatttgatgatgaactggt
>Sample2 29
ggatatgatgatgaactcct
>Sample2 reversed 10 3a 27
ggatatgatgatgaactggt

Am I missing something here?
Once again, thank you very much!
PS. I have uploaded the corresponding files soo you can take a look at them.

Last edited by Don Cragun; 06-20-2015 at 12:36 AM.. Reason: Get rid of extraneous SIZE tags.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

get cygpath to leave relative paths as relative?

If I execute mypath=`cygpath -w ../` echo $mypath I get d:\unix\nextVersion\script OK, d:\unix\nextVersion\script is the correct windows version of the path, but it is in absolute form. I would prefer it if cygpath left it in relative form, i.e. echo $mypath should output ..\ ... (0 Replies)
Discussion started by: fabulous2
0 Replies

2. Shell Programming and Scripting

UrgentPlease: compare 1 value with file values eliminating special characters

Hi All, I have file i have values like ---- 112 113 109 112 109 I have another file cat supplierDetails.txt ------------------------- 112|MIMUS|krishnaveni@google.com 113|MIMIRE|krishnaveni@google.com 114|MIMCHN|krishnaveni@google.com 115|CEL|krishnaveni@google.com... (10 Replies)
Discussion started by: kittusri9
10 Replies

3. Shell Programming and Scripting

How to pick values from column based on key values by usin AWK

Dear Guyz:) I have 2 different input files like this. I would like to pick the values or letters from the inputfile2 based on inputfile1 keys (A,F,N,X,Z). I have done similar task by using awk but in that case the inputfiles are similar like in inputfile2 (all keys in 1st column and values in... (16 Replies)
Discussion started by: repinementer
16 Replies

4. Shell Programming and Scripting

Replacing values in a file based on values in another file

Hi I have 2 files:- 1. List of files which consists of names of some output files. 2. A delimited file; delimted by "|" I want to replace the value of the $23 (23rd column) in the delimited file with name in the first file. It is always position to position. Meaning first row of the first... (5 Replies)
Discussion started by: pparthiv
5 Replies

5. UNIX for Dummies Questions & Answers

sum values based on ID

Hi, I would like to be able to sum up the counts of a column by the ID of another column. Example (although the actual file I have has thousands of IDs): Input file: A1BG-AS1:001 3 A1BG-AS1:002 0 A1BG-AS1:003 2 A1CF:001 1038 A1CF:002 105 A1CF:003 115 A1CF:004 137 Desired output... (3 Replies)
Discussion started by: fadista
3 Replies

6. Shell Programming and Scripting

Shell : eliminating zero values and printing

I have a log file containing the below data and should have the output file as below. and the output file should not contain any 0 values. Eg. It should not contain 0000000:0000000 in it. input.txt Media200.5.5.1 00010003:065D1202 Media100.5.5.2 7,588,666,067,931,543... (6 Replies)
Discussion started by: scriptscript
6 Replies

7. Shell Programming and Scripting

Eliminating sequences based on Distances

I have to remove sequences from a file based on the distance value. I am attaching the file containing the distances (Distance.xls) The second file looks something like this: Sequences.txt >Sample1 Freq 59 ggatatgatgatgaactggt >Sample1 Freq 54 ggatatgatgttgaactggt >Sample1 Freq 44... (2 Replies)
Discussion started by: Xterra
2 Replies

8. Shell Programming and Scripting

Choosing between repeated entries based on the "absolute values" of a column

Hello, I was looking for a way to select between the repeated entries (column1) based on the values of absolute values of column 3 (larger value). For example if the same gene id has FC value -2 and 1, I should get the output as -2. Kindly help. GeneID Description FC ... (2 Replies)
Discussion started by: Sanchari
2 Replies

9. UNIX for Dummies Questions & Answers

Sorting and saving values based on unique entries

Hi all, I wanted to save the values of a file that contains unique entries based on a specific column (column 4). my sample file looks like the following: input file: 200006-07file.txt 145 35 10 3 147 35 12 4 146 36 11 3 145 34 12 5 143 31 15 4 146 30 14 5 desired output files:... (5 Replies)
Discussion started by: ida1215
5 Replies

10. UNIX for Dummies Questions & Answers

Repositioning based on column values

Dear all ... I have a file which I want to change the structure based on the values in some columns and I would be grateful if you can help... one of my files looks like ... they all have ten rows 1,0,0 10,0,0 2,0,0 3,0,0 4,1,1 4,1,1 4,1,1 5,0,0 6,0,0 7,0,0 8,0.5,2 9,0.33,3 9,0.33,3... (1 Reply)
Discussion started by: A-V
1 Replies
Ace::Sequence::Feature(3pm)				User Contributed Perl Documentation			       Ace::Sequence::Feature(3pm)

NAME
Ace::Sequence::Feature - Examine Sequence Feature Tables SYNOPSIS
# open database connection and get an Ace::Object sequence use Ace::Sequence; # get a megabase from the middle of chromosome I $seq = Ace::Sequence->new(-name => 'CHROMOSOME_I, -db => $db, -offset => 3_000_000, -length => 1_000_000); # get all the homologies (a list of Ace::Sequence::Feature objs) @homol = $seq->features('Similarity'); # Get information about the first one $feature = $homol[0]; $type = $feature->type; $subtype = $feature->subtype; $start = $feature->start; $end = $feature->end; $score = $feature->score; # Follow the target $target = $feature->info; # print the target's start and end positions print $target->start,'-',$target->end, " "; DESCRIPTION
Ace::Sequence::Feature is a subclass of Ace::Sequence::Feature specialized for returning information about particular features in a GFF format feature table. OBJECT CREATION
You will not ordinarily create an Ace::Sequence::Feature object directly. Instead, objects will be created in response to a feature() call to an Ace::Sequence object. If you wish to create an Ace::Sequence::Feature object directly, please consult the source code for the new() method. OBJECT METHODS
Most methods are inherited from Ace::Sequence. The following methods are also supported: seqname() $object = $feature->seqname; Return the ACeDB Sequence object that this feature is attached to. The return value is an Ace::Object of the Sequence class. This corresponds to the first field of the GFF format and does not necessarily correspond to the Ace::Sequence object from which the feature was obtained (use source_seq() for that). source() method() subtype() $source = $feature->source; These three methods are all synonyms for the same thing. They return the second field of the GFF format, called "source" in the documentation. This is usually the method or algorithm used to predict the feature, such as "GeneFinder" or "tRNA" scan. To avoid ambiguity and enhance readability, the method() and subtype() synonyms are also recognized. feature() type() $type = $feature->type; These two methods are also synonyms. They return the type of the feature, such as "exon", "similarity" or "Predicted_gene". In the GFF documentation this is called the "feature" field. For readability, you can also use type() to fetch the field. abs_start() $start = $feature->abs_start; This method returns the absolute start of the feature within the sequence segment indicated by seqname(). As in the Ace::Sequence method, use start() to obtain the start of the feature relative to its source. abs_start() $start = $feature->abs_start; This method returns the start of the feature relative to the sequence segment indicated by seqname(). As in the Ace::Sequence method, you will more usually use the inherited start() method to obtain the start of the feature relative to its source sequence (the Ace::Sequence from which it was originally derived). abs_end() $start = $feature->abs_end; This method returns the end of the feature relative to the sequence segment indicated by seqname(). As in the Ace::Sequence method, you will more usually use the inherited end() method to obtain the end of the feature relative to the Ace::Sequence from which it was derived. score() $score = $feature->score; For features that are associated with a numeric score, such as similarities, this returns that value. For other features, this method returns undef. strand() $strand = $feature->strand; Returns the strandedness of this feature, either "+1" or "-1". For features that are not stranded, returns 0. reversed() $reversed = $feature->reversed; Returns true if the feature is reversed relative to its source sequence. frame() $frame = $feature->frame; For features that have a frame, such as a predicted coding sequence, returns the frame, either 0, 1 or 2. For other features, returns undef. group() info() target() $info = $feature->info; These methods (synonyms for one another) return an Ace::Object containing other information about the feature derived from the 8th field of the GFF format, the so-called "group" field. The type of the Ace::Object is dependent on the nature of the feature. The possibilities are shown in the table below: Feature Type Value of Group Field ------------ -------------------- note A Text object containing the note. similarity An Ace::Sequence::Homology object containing the target and its start/stop positions. intron An Ace::Object containing the gene from exon which the feature is derived. misc_feature other A Text object containing the group data. asString() $label = $feature->asString; Returns a human-readable identifier describing the nature of the feature. The format is: $type:$name/$start-$end for example: exon:ZK154.3/1-67 This method is also called automatically when the object is treated in a string context. SEE ALSO
Ace, Ace::Object, Ace::Sequence,Ace::Sequence::Homol, Ace::Sequence::FeatureList, GFF AUTHOR
Lincoln Stein <lstein@cshl.org> with extensive help from Jean Thierry-Mieg <mieg@kaa.crbm.cnrs-mop.fr> Copyright (c) 1999, Lincoln D. Stein This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See DISCLAIMER.txt for disclaimers of warranty. perl v5.14.2 2001-09-17 Ace::Sequence::Feature(3pm)
All times are GMT -4. The time now is 05:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy