Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7585527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T19:11:52+00:00 2026-05-30T19:11:52+00:00

I have this line samtools view -h file | awk ‘$3==chr$a || /^@/’ |

  • 0

I have this line

samtools view -h file | awk '$3=="chr$a" || /^@/' | samtools view -S - -b -o output

the dash between the -S and the -b is supposed to indicate to the program that it is from STDIN. I can run it from a perl script on the command line but as soon as I try to move it into a shell script it just creates the file without outputting any data. Any ideas would be greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T19:11:54+00:00Added an answer on May 30, 2026 at 7:11 pm

    In a shell script the $a inside single quotes will not be expanded:

    for a in {1..22} do 
      samtools view -h AD3.sorted.bam | awk '$3=="chr$a" || /^@/' | samtools view -S - -b -o chr$a.bam 
    done 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have this line of code in the view. <?php echo CHtml::activeTextField($model,'start_time'); ?>
i have this line of code in my view using the Telerik Grid: columns.Bound(o
I have this line in a CSV file: [2/16/2012] emailed...I honestly do not know
I have this line in my htaccess file: RewriteRule (.*) index.php This catches all
I have this line in my email.html.erb file: <%= link_to image_tag('video.png'), http://www.youtube.com/watch?v=QXhW34KzxL %> The
i have this line in the file: ,2,353867835022;11,353681041426390,272023201187741,272-02f-20017-06609,353854100352;11,,,,,,,0854100352,3,00,,O,D,DATA,,,7124395,,,17687,16,HPLMN,M20MSS_TTFILE_8377_20110528170245,M20MSS,W30B22I;0GRI3,1,20110528130013,170054,1,41,,,,,,,,0,,,,,,,,,,,,,,,,,,353868001820,,,,b60a5c0014,1:353867835022::::0854100352::353854100352,,,,,,,, Yes, this is a comma, separated
I have this line in a button click method on my aspx.cs file ClientScript.RegisterStartupScript(this.GetType(),
I have this line right at the top of my .php file <?php use_stylesheets_for_form($search_form)
i have this line somewhere in my JS file while(this.c.offsetWidth > this.w - s
I have this line in my View <h1 > Reply to: @Model.dialogueEntity[index].DialogueSubject</h1> and I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.