Sponsored Content
Top Forums Shell Programming and Scripting awk to print line based on two keywords Post 302997217 by Aia on Tuesday 9th of May 2017 11:56:08 PM
Old 05-10-2017
Quote:
Originally Posted by cmccabe
[...]
desired output
Code:
SVTYPE=Fusion;READ_COUNT=1868;GENE_NAME=ETV6;EXON_NUM=4;RPM=1.5825e-09;NORM_COUNT=0.001582480886121524;ANNOTATION=COSF823;FUNC=[{'gene':'ETV6','exon':'4','oncomineGeneClass':'Gain-of-Function','oncomineVariantClass':'Fusion'}]     GT:GQ    ./.:.
chr15    88483984    ETV6-NTRK3.E4N15.COSF823.1_2    T    ]chr12:12006495]T    .    PASS

Your desired output is comprised of two different records, therefore it cannot be handled by the logic you are using.

Unfortunately, your one sample introduces ambiguity which makes it hard to guess for a possible alternative.
This User Gave Thanks to Aia For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Capture lines based on keywords

Hello everyone, I am trying to write a script that will capture few lines from a text file based on 2 keywords in the first line and 1 keyword in the last one. It could also be based on the first line only + the folllowing 3 lines. Could some one help or give directions. Thanks. (4 Replies)
Discussion started by: nimo
4 Replies

2. Shell Programming and Scripting

Print entire line based on value in a column

Friends, File1.txt abc|0|xyz 123|129|opq def|0|678 890|pqw|sdf How do I print the entire line where second column has value is 0? Expected Result: abc|0|xyz def|0|678 Thanks, Prashant ---------- Post updated at 02:14 PM ---------- Previous update was at 02:06 PM ---------- ... (1 Reply)
Discussion started by: ppat7046
1 Replies

3. Shell Programming and Scripting

Print selection of line based on line number

Hi Unix gurus Basically i am searching for the pattern and getting the line numbers of the grepped pattern. I am trying to print the series of lines from 7 lines before the grepped line number to the grepped line number. I am trying to use the following code. but it is not working. cat... (3 Replies)
Discussion started by: mohanm
3 Replies

4. Shell Programming and Scripting

awk to print lines based on string match on another line and condition

Hi folks, I have a text file that I need to parse, and I cant figure it out. The source is a report breaking down softwares from various companies with some basic info about them (see source snippet below). Ultimately what I want is an excel sheet with only Adobe and Microsoft software name and... (5 Replies)
Discussion started by: rowie718
5 Replies

5. UNIX for Advanced & Expert Users

Forwarding based on keywords in sendmail

I have an application that runs on the server with root privileges and all emails it sends get sent to root (errors, logs, etc), when they should actually go to one of application admins. I would like to separate these emails from the OS related one sent to root and forward them to that... (2 Replies)
Discussion started by: vostrushka
2 Replies

6. Shell Programming and Scripting

HELP: Shell Script to read a Log file line by line and extract Info based on KEYWORDS matching

I have a LOG file which looks like this Import started at: Mon Jul 23 02:13:01 EDT 2012 Initialization completed in 2.146 seconds. -------------------------------------------------------------------------------- -- Import summary for Import item: PolicyInformation... (8 Replies)
Discussion started by: biztank
8 Replies

7. Shell Programming and Scripting

awk to print specific line in file based on criteria

In the file below I am trying to extract a specific instance of path, if the adjacent plugin": "/rundb/api/v1/plugin/49/. Thank you :). file "path": "/results/analysis/output/Home/Auto_user_S5-00580-4-Medexome_65_028/plugin_out/FileExporter_out.52", "plugin": "/rundb/api/v1/plugin/49/",... (8 Replies)
Discussion started by: cmccabe
8 Replies

8. Shell Programming and Scripting

Split content based on keywords

I need to split the file contents with multiple rows based on patterns Sample: Input: ABC101testXYZ102UKMNO1092testing ABC999testKMNValid Output: ABC101test XYZ102U KMN1092testing ABC999test KMNValid In this ABC , XYZ and KMN are patterns Continue here./mod] Please read forum... (1 Reply)
Discussion started by: Jairaj
1 Replies

9. UNIX for Beginners Questions & Answers

Split content based on keywords

I need to split the file contents with multiple rows based on patterns Sample: Input: ABC101testXYZ102UKMNO1092testing ABC999testKMNValid Output: ABC101test XYZ102U KMN1092testing ABC999test KMNValid In this ABC , XYZ and KMN are patterns (6 Replies)
Discussion started by: Jairaj
6 Replies

10. UNIX for Beginners Questions & Answers

Reading a file line by line and print required lines based on pattern

Hi All, i want to write a shell script read below file line by line and want to exclude the lines which contains empty value for MOUNTPOINT field. i am using centos 7 Operating system. want to read below file. # cat /tmp/d5 NAME="/dev/sda" TYPE="disk" SIZE="60G" OWNER="root"... (4 Replies)
Discussion started by: balu1234
4 Replies
BP_GENBANK2GFF3(1p)					User Contributed Perl Documentation				       BP_GENBANK2GFF3(1p)

NAME
genbank2gff3.pl -- Genbank->gbrowse-friendly GFF3 SYNOPSIS
genbank2gff3.pl [options] filename(s) # process a directory containing GenBank flatfiles perl genbank2gff3.pl --dir path_to_files --zip # process a single file, ignore explicit exons and introns perl genbank2gff3.pl --filter exon --filter intron file.gbk.gz # process a list of files perl genbank2gff3.pl *gbk.gz # process data from URL, with Chado GFF model (-noCDS), and pipe to database loader curl ftp://ftp.ncbi.nih.gov/genomes/Saccharomyces_cerevisiae/CHR_X/NC_001142.gbk | perl genbank2gff3.pl -noCDS -in stdin -out stdout | perl gmod_bulk_load_gff3.pl -dbname mychado -organism fromdata Options: --noinfer -r don't infer exon/mRNA subfeatures --conf -i path to the curation configuration file that contains user preferences for Genbank entries (must be YAML format) (if --manual is passed without --ini, user will be prompted to create the file if any manual input is saved) --sofile -l path to to the so.obo file to use for feature type mapping (--sofile live will download the latest online revision) --manual -m when trying to guess the proper SO term, if more than one option matches the primary tag, the converter will wait for user input to choose the correct one (only works with --sofile) --dir -d path to a list of genbank flatfiles --outdir -o location to write GFF files (can be 'stdout' or '-' for pipe) --zip -z compress GFF3 output files with gzip --summary -s print a summary of the features in each contig --filter -x genbank feature type(s) to ignore --split -y split output to separate GFF and fasta files for each genbank record --nolump -n separate file for each reference sequence (default is to lump all records together into one output file for each input file) --ethresh -e error threshold for unflattener set this high (>2) to ignore all unflattener errors --[no]CDS -c Keep CDS-exons, or convert to alternate gene-RNA-protein-exon model. --CDS is default. Use --CDS to keep default GFF gene model, use --noCDS to convert to g-r-p-e. --format -f Input format (SeqIO types): GenBank, Swiss or Uniprot, EMBL work (GenBank is default) --GFF_VERSION 3 is default, 2 and 2.5 and other Bio::Tools::GFF versions available --quiet don't talk about what is being processed --typesource SO sequence type for source (e.g. chromosome; region; contig) --help -h display this message DESCRIPTION
This script uses Bio::SeqFeature::Tools::Unflattener and Bio::Tools::GFF to convert GenBank flatfiles to GFF3 with gene containment hierarchies mapped for optimal display in gbrowse. The input files are assumed to be gzipped GenBank flatfiles for refseq contigs. The files may contain multiple GenBank records. Either a single file or an entire directory can be processed. By default, the DNA sequence is embedded in the GFF but it can be saved into separate fasta file with the --split(-y) option. If an input file contains multiple records, the default behaviour is to dump all GFF and sequence to a file of the same name (with .gff appended). Using the 'nolump' option will create a separate file for each genbank record. Using the 'split' option will create separate GFF and Fasta files for each genbank record. Notes 'split' and 'nolump' produce many files In cases where the input files contain many GenBank records (for example, the chromosome files for the mouse genome build), a very large number of output files will be produced if the 'split' or 'nolump' options are selected. If you do have lists of files > 6000, use the --long_list option in bp_bulk_load_gff.pl or bp_fast_load_gff.pl to load the gff and/ or fasta files. Designed for RefSeq This script is designed for RefSeq genomic sequence entries. It may work for third party annotations but this has not been tested. But see below, Uniprot/Swissprot works, EMBL and possibly EMBL/Ensembl if you don't mind some gene model unflattener errors (dgg). G-R-P-E Gene Model Don Gilbert worked this over with needs to produce GFF3 suited to loading to GMOD Chado databases. Most of the changes I believe are suited for general use. One main chado-specific addition is the --[no]cds2protein flag My favorite GFF is to set the above as ON by default (disable with --nocds2prot) For general use it probably should be OFF, enabled with --cds2prot. This writes GFF with an alternate, but useful Gene model, instead of the consensus model for GFF3 [ gene > mRNA> (exon,CDS,UTR) ] This alternate is gene > mRNA > polypeptide > exon means the only feature with dna bases is the exon. The others specify only location ranges on a genome. Exon of course is a child of mRNA and protein/peptide. The protein/polypeptide feature is an important one, having all the annotations of the GenBank CDS feature, protein ID, translation, GO terms, Dbxrefs to other proteins. UTRs, introns, CDS-exons are all inferred from the primary exon bases inside/outside appropriate higher feature ranges. Other special gene model features remain the same. Several other improvements and bugfixes, minor but useful are included * IO pipes now work: curl ftp://ncbigenomes/... | genbank2gff3 --in stdin --out stdout | gff2chado ... * GenBank main record fields are added to source feature, e.g. organism, date, and the sourcetype, commonly chromosome for genomes, is used. * Gene Model handling for ncRNA, pseudogenes are added. * GFF header is cleaner, more informative. --GFF_VERSION flag allows choice of v2 as well as default v3 * GFF ##FASTA inclusion is improved, and CDS translation sequence is moved to FASTA records. * FT -> GFF attribute mapping is improved. * --format choice of SeqIO input formats (GenBank default). Uniprot/Swissprot and EMBL work and produce useful GFF. * SeqFeature::Tools::TypeMapper has a few FT -> SOFA additions and more flexible usage. TODO
Are these additions desired? * filter input records by taxon (e.g. keep only organism=xxx or taxa level = classYYY * handle Entrezgene, other non-sequence SeqIO structures (really should change those parsers to produce consistent annotation tags). Related bugfixes/tests These items from Bioperl mail were tested (sample data generating errors), and found corrected: From: Ed Green <green <at> eva.mpg.de> Subject: genbank2gff3.pl on new human RefSeq Date: 2006-03-13 21:22:26 GMT -- unspecified errors (sample data works now). From: Eric Just <e-just <at> northwestern.edu> Subject: bp_genbank2gff3.pl Date: 2007-01-26 17:08:49 GMT -- bug fixed in genbank2gff3 for multi-record handling This error is for a /trans_splice gene that is hard to handle, and unflattner/genbank2 doesn't From: Chad Matsalla <chad <at> dieselwurks.com> Subject: genbank2gff3.PLS and the unflatenner - Inconsistent order? Date: 2005-07-15 19:51:48 GMT AUTHOR
Sheldon McKay (mckays@cshl.edu) Copyright (c) 2004 Cold Spring Harbor Laboratory. AUTHOR of hacks for GFF2Chado loading Don Gilbert (gilbertd@indiana.edu) perl v5.14.2 2012-03-02 BP_GENBANK2GFF3(1p)
All times are GMT -4. The time now is 12:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy