Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
how_to [2022/08/04 11:52] – [Add only modified changes and ignore untracked files using git?] javadhow_to [2022/08/10 02:20] – [Run simultaneous jobs (on multiple files) in a single mpi on a cluster?] mohsen
Line 2: Line 2:
  
 This is a collection of short answers and links to some miscellaneous questions that we have had while doing research in Oncinfo. This can also be a useful resource for other scholars in the field of computational biology with similar interests and challenges. This is a collection of short answers and links to some miscellaneous questions that we have had while doing research in Oncinfo. This can also be a useful resource for other scholars in the field of computational biology with similar interests and challenges.
 +
 +----
 +
 +==== Extend   bam  reads to a fixed fragment size to better view peaks with   igv   ====
 +
 +Assume you have ''input.bam'' which contains mapped short single-end sequence reads, but you know the fragment size=''100''. With the following command, you can make a bam file that have the extended reads, but you will miss the actual reads. This helps to better visualize the actual read signal:
 +<code>
 +bedtools bamtobed -i input.bam | \
 +awk -F'\t' 'BEGIN {OFS = FS} {if ($6=="+") {$3=$2+99} else {$2=$3-99}; if ($2<0) {$2=0}; print $0;}' | \
 +bedtools bedtobam -i -> extended_input.bam
 +</code>
  
 ---- ----
Line 112: Line 123:
 ---- ----
  
-===== Add only modified changes and ignore untracked files using git=====+===== Add only modified changes and ignore untracked files using git===== 
 + 
 +Using newer version of `git` (e.g., >=2.32.1),
  
 <code> <code>
-git ls-files --modified | xargs git add; git commit -'minor changes'; git push+git commit -am 'minor changes'; git push
 </code> </code>
  
-The [[https://stackoverflow.com/questions/7124726/git-add-only-modified-changes-and-ignore-untracked-files|above]] should work if there is no conflict. If there is a conflict at push time, first pull. Now, you need to look for ">>>" in the codeand manually fix the conflictThenpush again. +⚠️ <font inherit/inherit;;#e74c3c;;inherit>Caution</font>: With older versions the -a option will add all files in the directorywhich is usually NOT what you wantInsteaduse following command, which would have the same effect as above:
- +
-PS: +
- +
-by the new version of `git` the following would have the same effect as above:+
  
 <code> <code>
-git commit -am 'minor changes'; git push+git ls-files --modified | xargs git add; git commit -'minor changes'; git push
 </code> </code>
 +
 +The [[https://stackoverflow.com/questions/7124726/git-add-only-modified-changes-and-ignore-untracked-files|above]] should work if there is no conflict. If there is a conflict at push time, first pull. Now, you need to look for ">>>" in the code, and manually fix the conflict. Then, push again.
  
 ---- ----