Very simple problem I am not able to solve. I have been trying to modify the following code:
What I am tryng to acccomplish, I have a bunch of files where the first number at the top is the number of sequences followed by the length of the sequences. Then, the first column is the SequenceID followed by the actual sequence, something like this:
Now the second number in the top is = 20 which corresponds to the length of the sequences. Then, I need to 'slide' the window let say 10 characters and grab the following 20 characters and create a second file named block2.fas, so on and so forth.
I need to include at the very top of each output (block?) file the number of sequences (12 in this particular case) followed by the length of the sequences (in my example 20).
I just do not know how to do it!
I will be very thankful if someone can help me with this problem!
Thanks in advance!
awk 'NR==1{s=$1}{l=length($2)>l?length($2):l}END {for (i = 1; i <= l; i += wn) print s FS mx > ("block" ++c)}' mx=50 wn=10 infile.txt
awk 'NR>1 {t=$1;c = x; for (i = 1; i <= length($2); i += wn)print t FS"" substr($2, i, mx) >> ("block" ++c)}' mx=50 wn=10 infile.txt
Is it possible to toggle back and forth between an xterm invoked from one tty, and a shell invoked from a different tty?
I am running Centos 7 with KDE and booting in non-graphic mode. After logging in on the default window (/dev/tty1) , I can then use ALT-F2 to access a new window (/dev/tty2),... (1 Reply)
Hi Unix Gurus,
I have a file with data like:
>header_1
TCCCCGA
>header_2
CCAATTGGGTA
The data to work with starts from the next line after '>header_xx'.
(1)
I want to search the three letter patterns 'CHH' or 'DDG' and replace C and G by exclamation ! so that CHH becomes !HH and DDG... (3 Replies)
I have a sting of "0"s and "1"s that I need to analyze. I need to look at each "1" and determine if it is in a neighborhood that is enriched for "1"s which means it is one of at least three "1"s in a 4 character window. My desired output is a count of "1"s in an enriched area.
For Example
Input... (1 Reply)
I'm doing a little work that involves computing the average completion time of the last 5 of many file decompressions. It's not too tough, but I'm wondering if maybe there's a better way to write it. This is a bash script; here's the current idea:
ctime5=$ctime4
ctime4=$ctime3
ctime3=$ctime2... (2 Replies)
Hi!
I have some sequencing data that I have aligned using maq software
Now, I have data that looks like this each line is a 'tag'
chr1 10001
chr1 10002
chr1 10005
chr1 10007
chr1 10008
chr1 10008
chr1 10008
chr1 10019
chr1 10019
chr1 10020
What I really want to find out is how... (1 Reply)
I have a script like this ...
#!/bin/ksh
database=$(echo $@ | sed 's/.*-S \(*\).*/\1/')
instance=$(grep $database /var/opt/oracle/oratab | awk -F : '{print $1}')
command=$(echo $@ | sed "s/$database/$instance/")
echo $command
if I execute this script in ksh or bash it works fine .
... (3 Replies)
Hi everyone!
I have a strange situation. I'm running an NX remote Gnome desktop session. On the remote machine, there is a whole load of unsaved data in a window. A problem that I've been having with this NX session is that I can't load Gnome Applets, including the Window Switcher. So.. when I... (0 Replies)
Hello,
We someone help me resolve this problem. I have window 2000 professional, windows 98 and Unixware 7.0.1 on the network. I was able to establish connection with all. However, l was unable to ping window 98 from window 2000 professional. I was able to ping the window 2000 from the window... (10 Replies)