question
stringlengths
6
13.7k
text
stringlengths
1
25.8k
source
stringclasses
3 values
simulate this circuit – Schematic created using CircuitLab My physics teacher said that the current through the resistor is 4A because each battery has a current of 2A if hooked up to the resistor on its own, and so they both have 2A of current through them so the resistor has 4A total through it because of the junctio...
Just ask her what the voltage across the resistor is
https://api.stackexchange.com
Over on the TeX stackexchange, we have been discussing how to detect "rivers" in paragraphs in this question. In this context, rivers are bands of white space that result from accidental alignment of interword spaces in the text. Since this can be quite distracting to a reader bad rivers are considered to be a symptom...
I have thought about this some more, and think that the following should be fairly stable. Note that I have limited myself to morphological operations, because these should be available in any standard image processing library. (1) Open image with a nPix-by-1 mask, where nPix is about the vertical distance between lett...
https://api.stackexchange.com
Thanks to everyone who posted comments/answers to my query yesterday (Implementing a Kalman filter for position, velocity, acceleration ). I've been looking at what was recommended, and in particular at both (a) the wikipedia example on one dimensional position and velocity and also another website that considers a si...
Is this a valid way of introducing speed estimates into the process? If you choose your state appropriately, then the speed estimates come "for free". See the derivation of the signal model below (for the simple 1-D case we've been looking at). Signal Model, Take 2 So, we really need to agree on a signal model before ...
https://api.stackexchange.com
I have R data frame like this: age group 1 23.0883 1 2 25.8344 1 3 29.4648 1 4 32.7858 2 5 33.6372 1 6 34.9350 1 7 35.2115 2 8 35.2115 2 9 35.2115 2 10 36.7803 1 ... I need to get data frame in the following form: group mean sd 1 34.5 5.6 2...
Here is the plyr one line variant using ddply: dt <- data.frame(age=rchisq(20,10),group=sample(1:2,20,rep=T)) ddply(dt,~group,summarise,mean=mean(age),sd=sd(age)) Here is another one line variant using new package data.table. dtf <- data.frame(age=rchisq(100000,10),group=factor(sample(1:10,100000,rep=T))) dt <- data....
https://api.stackexchange.com
Is there a generically accepted method of removing motion blur from an image. For a simple case, we can assume that motion happens in a straight line. I assume that it's a two part process composed of motion estimation and then deconvolution, but how is it actually done?
Yes, deconvolution. This page describes a number of deconvolution methods and methods for estimating the point spread function: Removing Motion Blur from Astrophotographic Images They say the deconvolution literature is "extremely extensive". They choose Lucy-Richardson algorithm for deconvolution and develop thei...
https://api.stackexchange.com
Darwin suggested that sexual selection, especially by female choice, may counter natural selection. Theoretical models, such as a Fisherian runaway process, suggest that evolution of preference and preferred phenotypes may drive each other in ever increasing speed. Because one male may fertilize many females, one coul...
TL;DR: There is a dearth of actual experimental evidence. However: there is at least one study that confirmed the process ([STUDY #7] - Myxococcus xanthus; by Fiegna and Velicer, 2003). Another study experimentally confirmed higher extinction risk as well ([STUDY #8] - Paul F. Doherty's study of dimorphic bird spec...
https://api.stackexchange.com
I have a FASTA file with 100+ sequences like this: >Sequence1 GTGCCTATTGCTACTAAAA ... >Sequence2 GCAATGCAAGGAAGTGATGGCGGAAATAGCGTTA ...... I also have a text file like this: Sequence1 40 Sequence2 30 ...... I would like to simulate next-generation paired-end reads for all the sequences in my FASTA file. For Sequence1...
I am working on a Illumina sequencing simulator for metagenomics: InSilicoSeq It is still in alpha release and very experimental, but given a multi-fasta and an abundance file, it will generate reads from your input genomes with different coverages. From the documentation: iss generate --genomes genomes.fasta --abundan...
https://api.stackexchange.com
I am trying to write a script that generates random graphs and I need to know if an edge in a weighted graph can have the 0 value. actually it makes sense that 0 could be used as an edge's weight, but I've been working with graphs in last few days and I have never seen an example of it.
Allowed by whom? There is no Central Graph Administration that decides what you can and cannot do. You can define objects in any way that's convenient for you, as long as you're clear about what the definition is. If zero-weighted edges are useful to you, then use them; just make sure your readers know that's what you'...
https://api.stackexchange.com
The wikipedia page claims that likelihood and probability are distinct concepts. In non-technical parlance, "likelihood" is usually a synonym for "probability," but in statistical usage there is a clear distinction in perspective: the number that is the probability of some observed outcomes given a set of parameter va...
The answer depends on whether you are dealing with discrete or continuous random variables. So, I will split my answer accordingly. I will assume that you want some technical details and not necessarily an explanation in plain English. Discrete Random Variables Suppose that you have a stochastic process that takes disc...
https://api.stackexchange.com
I have a camera matrix (I know both intrinsic and extrinsic parameters) known for image of size HxW. (I use this matrix for some calculations I need). I want to use a smaller image, say: $\frac{H}{2}\times \frac{W}{2}$ (half the original). What changes do I need to make to the matrix, in order to keep the same relation...
Note: That depends on what coordinates you use in the resized image. I am assuming that you are using zero-based system (like C, unlike Matlab) and 0 is transformed to 0. Also, I am assuming that you have no skew between coordinates. If you do have a skew, it should be multiplied as well Short answer: Assuming that yo...
https://api.stackexchange.com
If there are soft clipped base pairs specified in the CIGAR string for a read in a SAM/BAM file, will these be used for variant calling in a samtools + bcftools workflow? The GATK HaplotypeCaller, for example, has an explicit option --dontUseSoftClippedBases for whether to use soft clipped bases. The samtools document...
No, samtools (and therefore bcftools) does not use soft-clipped bases. You can quickly confirm this by using either samtools depth or samtools mpileup to look at a region with a soft-clipped alignment. You'll note that the soft-clipped region isn't used in the depth/pileup (both tools use the same underlying code, so i...
https://api.stackexchange.com
Safe programming languages (PL) are gaining popularity. What is the formal definition of safe PL? For example, C is not safe, but Java is safe. I suspect that the property “safe” should be applied to a PL implementation rather than to the PL itself. If so, how do we define what is a safe PL implementation?
There is no formal definition of "safe programming language"; it's an informal notion. Rather, languages that claim to provide safety usually provide a precise formal statement of what kind of safety is being claimed/guaranteed/provided. For instance, the language might provide type safety, memory safety, or some oth...
https://api.stackexchange.com
Are there NP-complete problems which have proven subexponential-time algorithms? I am asking for the general case inputs, I am not talking about tractable special cases here. By sub-exponential, I mean an order of growth above polynomials, but less than exponential, for example $n^{\log n}$.
Depends on what you mean by subexponential. Below I explain a few meanings of "subexponential" and what happens in each case. Each of these classes is contained in the classes below it. I. $2^{n^{o(1)}}$ If by subexpoential you mean $2^{n^{o(1)}}$, then a conjecture in complexity theory called ETH (Exponential Time Hy...
https://api.stackexchange.com
I was just watching a mega factory video and wondered why they use an AC motor which requires a power inverter instead of DC which may be powered directly from their DC battery? Introducing an inverter means more cost (weight, controller, etc). Are there any reasons for that? What are the differences between an AC and ...
You're asking about the technical tradeoffs surrounding the selection of a traction motor for an electric vehicle application. Describing the full design tradespace is far beyond what can reasonably be summarized here, but I'll outline the prominent design tradeoffs for such an application. Because the amount of energy...
https://api.stackexchange.com
I was looking in the Android app store for a guitar tuner. I found a tuner app that claimed it was faster than other apps. It claimed it could find the frequency without using the DFT (I wish I still had the URL to this specification). I have never heard of this. Can you acquire an audio signal and compute the frequenc...
FFT is actually not a great way of making a tuner. FFT has inherently a finite frequency resolution and it's not easy to detect very small frequency changes without making the time window extremely long which makes it unwieldy and sluggish. Better solutions can be based on phase-locked loops, delay-locked loops, auto ...
https://api.stackexchange.com
We can sometimes see decades-old capacitors (such as ones made in the USSR) still working. They are bigger and heavier, but durable and not desiccating. Modern aluminium capacitors serve for about 11 years, if you are lucky, then become dry and quietly fail. I remember early 2000s devices where capacitors failed after ...
There was a period of time where lots of capacitors were made with a dodgy electrolyte, especially by some large Taiwanese manufacturers. The capacitors looked OK in a wide variety of tests when new, but they didn't age well. Because it took a few years for the capacitors to fail, and the high failure rate to become k...
https://api.stackexchange.com
This is a question that has been in my mind since I was a kid. I'm not a doctor, nor even a biology student, just a curious person. What is the minimum and maximum temperature a human body can stand without dying or suffering severe consequences (eg. a burn or a freeze)? While at this subject, how much more global warm...
Hypothermia (when the body is too cold) is said to occur when the core body temperature of an individual has dropped below 35° celsius. Normal core body temperature is 37°C. (1) Hypothermia is then further subdivided into levels of seriousness (2) (although all can be damaging to health if left for an extended period ...
https://api.stackexchange.com
Scholarly papers in scientific computing (and many other fields, nowadays) typically involve some amount of code or even whole software packages that were written specifically for that paper or were used to obtain results in the paper. What is the best way to help readers of the paper access the code? My current appr...
Well, I think you have a few options. If you have a stable page—such as one sponsored by a university or other non-profit institution that's unlikely to vanish anytime soon—you could publish there. You could use a service like Github or Bitbucket or SourceForge to distribute the code. If the code is of marginal genera...
https://api.stackexchange.com
What is the basic difference between aqueous and alcoholic $\ce{KOH}$? Why does alcoholic $\ce{KOH}$ prefer elimination whereas aqueous $\ce{KOH}$ prefers substitution?
$$\ce{R-OH + OH- <=> RO- + H2O }$$ In alcoholic solution, the $\ce{KOH}$ is basic enough ($\mathrm{p}K_{\mathrm{a}} =15.74$) to deprotonate a small amount of the alcohol molecules ($\mathrm{p}K_{\mathrm{a}}= 16–17$), thus forming alkoxide salts ($\ce{ROK}$). The alkoxide anions $\ce{RO-}$ are not only more basic than p...
https://api.stackexchange.com
A very common problem in Markov Chain Monte Carlo involves computing probabilities that are sum of large exponential terms, $ e^{a_1} + e^{a_2} + ... $ where the components of $a$ can range from very small to very large. My approach has been to factor out the largest exponential term $K := \max_{i}(a_{i})$ so that: $$...
There is a straightforward solution with only two passes through the data: First compute $$K := \max_i\; a_i,$$ which tells you that, if there are $n$ terms, then $$\sum_i e^{a_i} \le n e^K.$$ Since you presumably don't have $n$ anywhere near as large as even $10^{20}$, you should have no worry about overflowing in the...
https://api.stackexchange.com
The problem I'm currently working on a Finite Element Navier Stokes simulation and I would like to investigate the effects of a variety of parameters. Some parameters are specified in an input file or via a command line options; other parameters are provided as flags in a Makefile so my code has to be recompiled whenev...
If you want to write something general-purpose, you can do it either with shell scripts if it is something very simple, as Pedro suggests, or aggregate in a higher-level mathematical programming language such as Python or MATLAB. I agree that plain text files are useful for smaller amounts of data, but you should prob...
https://api.stackexchange.com
As I am currently in a war zone, I don't have many options for cabling. I found this clothesline (steel core plastic wire rope) that appears to be one mm of diameter (steel core diameter.) 13 meters of it measured 7 ohms resistance. Edit: It is 3.8 Ω and not 7. The first multimeter test lead probes had 2-4 resistance w...
Steel, having just around 10 times higher resistivity than copper means it will take ten times the conductor area to match copper. If you measured 13 meter of it to 3.8 Ω, the cross sectional area would be 2 mm^2, assuming 5.95*10^-7 Ωm of resistivity for "high alloy steel" (this varies greatly unfortunately so assume ...
https://api.stackexchange.com
Why can't you use a single resistor for a number of LEDs in parallel instead of one each?
The main reason is because you can't safely connect diodes in parallel. So when we use one resistor, we have a current limit for the whole diode section. After that it's up to each diode to control the current that goes through it. The problem is that real world diodes don't have same characteristics and therefore the...
https://api.stackexchange.com
How do I identify the markings on an SMT component and match it up with a part number so I can be a good designer and actually look at a datasheet (and read the whole thing)? Or identify a part to replace an unknown part on a PCB?
Step 1) Identify the package, note how many pins, match up the pins first. Note that sometimes the package pins are underneath the part or extended away from the part. Also get the dimensions of the part with a ruler or (preferably) calipers and match them up with a chart, write them down for a later step. One way you ...
https://api.stackexchange.com
As an exercise I sat down and derived the magnetic field produced by moving charges for a few contrived situations. I started out with Coulomb's Law and Special Relativity. For example, I derived the magnetic field produced by a current $I$ in an infinite wire. It's a relativistic effect; in the frame of a test charge,...
Maxwell's equations do follow from the laws of electricity combined with the principles of special relativity. But this fact does not imply that the magnetic field at a given point is less real than the electric field. Quite on the contrary, relativity implies that these two fields have to be equally real. When the pri...
https://api.stackexchange.com
There's a lot of discussion going on on this forum about the proper way to specify various hierarchical models using lmer. I thought it would be great to have all the information in one place. A couple of questions to start: How to specify multiple levels, where one group is nested within the other: is it (1|group1:gr...
What's the difference between (~1 +....) and (1 | ...) and (0 | ...) etc.? Say you have variable V1 predicted by categorical variable V2, which is treated as a random effect, and continuous variable V3, which is treated as a linear fixed effect. Using lmer syntax, simplest model (M1) is: V1 ~ (1|V2) + V3 This model w...
https://api.stackexchange.com
What is the relationship, if any, between Kalman filtering and (repeated, if necessary) least squares polynomial regression?
1. There is a Difference in terms of optimality criteria Kalman filter is a Linear estimator. It is a linear optimal estimator - i.e. infers model parameters of interest from indirect, inaccurate and uncertain observations. But optimal in what sense? If all noise is Gaussian, the Kalman filter minimizes the mean square...
https://api.stackexchange.com
I have a simple question that is really hard to Google (besides the canonical What Every Computer Scientist Should Know About Floating-Point Arithmetic paper). When should functions such as log1p or expm1 be used instead of log and exp? When should they not be used? How do different implementations of those functions d...
We all know that \begin{equation} \exp(x) = \sum_{n=0}^\infty \frac{x^n}{n!} = 1 + x + \frac12 x^2 + \dots \end{equation} implies that for $|x| \ll 1$, we have $\exp(x) \approx 1 + x$. This means that if we have to evaluate in floating point $\exp(x) -1$, for $|x| \ll 1$ catastrophic cancellation can occur. This can be...
https://api.stackexchange.com
In Q29 of Joint Entrance Exam (JEE) 2016 India, the official answer key mentions that benzoin gives Tollen's test. However, I saw this post which says that it doesn't: Benzoin: I'm very confused now. If benzoin does give the test, how? And what is the mechanism/intermediate involved? I thought of all possible reaction...
Of your three "thoughts", you are correct that an aldol reaction is not an option. Not only is the product "crowded", but the reaction is reversible. [BTW, an aldol condensation occurs when water is eliminated from the initial aldol product. In the case of a benzoin aldol product, elimination of water is impossible.] ...
https://api.stackexchange.com
I am writing a software tool to which I would like to add the ability to compute alignments using the efficient Burrows-Wheeler Transform (BWT) approach made popular by tools such as BWA and Bowtie. As far as I can tell, though, both of these tools and their derivatives are invoked strictly via a command-line interface...
First, let us remark that there exist several hundred read mappers, most of which have been even published (see, e.g., pages 25-29 of this thesis). Developing a new mapper probably makes sense only as a programming exercise. Whereas developing a quick proof-of-concept read mapper is usually easy, turning it into a real...
https://api.stackexchange.com
This is the mathematical expression for Harris corner detection: But I have the following doubts: What is the physical significance of $u$ and $v$? Many references say it is the magnitude by which the window $w$ shifted. So how much is the window shifted? One pixel or two pixels? Is the summation over the pixel posit...
The meaning of that formula is really quite simple. Imagine you take two same-sized small areas of an image, the blue one and the red one: The window function equals 0 outside the red rectangle (for simplicity, we can assume the window is simply constant within the red rectangle). So the window function selects which ...
https://api.stackexchange.com
I have read before in one of Seiberg's articles something like, that gauge symmetry is not a symmetry but a redundancy in our description, by introducing fake degrees of freedom to facilitate calculations. Regarding this I have a few questions: Why is it called a symmetry if it is not a symmetry? what about Noether th...
In order: Because the term "gauge symmetry" pre-dates QFT. It was coined by Weyl, in an attempt to extend general relativity. In setting up GR, one could start with the idea that one cannot compare tangent vectors at different spacetime points without specifying a parallel transport/connection; Weyl tried to extend th...
https://api.stackexchange.com
All mammals that I can think of have a high degree of bilateral symmetry (In fact, almost every animal I can think of is like this). So why is the human heart not exactly in the middle of the body? An effect of this is that one lung is slightly smaller. Are there any evolutionary theories on why this came to be?
First of all, let me make it clear that the heart is at the vertical centre of the body -- it is not shifted towards left (or right). However, it is slightly tilted towards the left in most cases. In some cases, it is tilted towards the right, and the condition is called Dextrocardia. For why it is so, lets look at w...
https://api.stackexchange.com
For a very long time I have been wondering, where does electricity go after being used? When I use my tablet it runs from a battery. Where does the power go?
"Electricity" is not a thing, more like a concept. "Amount of electricity" does not have a real meaning. You can have some specified amount of power, voltage, current, or other measurable properties, but not "electricity". For those that don't fully understand current, voltage, and power, it is best to just avoid us...
https://api.stackexchange.com
I'm wondering why exactly the single bond between two sulfur atoms is stronger than that of two oxygen atoms. According to this page, an $\ce{O-O}$ bond has an enthalpy of $142~\mathrm{kJ~mol^{-1}}$, and a $\ce{S-S}$ bond in $\ce{S8}$ an enthalpy of $226~\mathrm{kJ~mol^{-1}}$. This one reports the $\ce{S-S}$ bond entha...
TL;DR: The $\ce{O-O}$ and $\ce{S-S}$ bonds, such as those in $\ce{O2^2-}$ and $\ce{S2^2-}$, are derived from $\sigma$-type overlap. However, because the $\pi$ and $\pi^*$ MOs are also filled, the $\pi$-type overlap also affects the strength of the bond, although the bond order is unaffected. Bond strengths normally dec...
https://api.stackexchange.com
Several sources describe the initial failures in the realization of a successful mRNA vaccine. E.g., this 2017 article from Stat describes the following problem faced by Moderna while working on one of their mRNA vaccines: The safe dose was too weak, and repeat injections of a dose strong enough to be effective had tr...
Answering my own question after reading the 2018 Nature review article “mRNA vaccines — a new era in vaccinology” The resources and motivation engendered by the COVID-19 pandemic are a major factor in the development of the first mRNA vaccines approved by national governments. However, before the COVID-19 pandemic, the...
https://api.stackexchange.com
I'm currently trying to assembly a genome from a rodent parasite, Nippostrongylus brasiliensis. This genome does have an existing reference genome, but it is highly fragmented. Here are some continuity statistics for the scaffolds of the current Nippo reference genome (assembled from Illumina reads): Total sequences: 2...
"A few" 100kb reads won't help much. You need to apply the ultra-long protocol, which is different from the standard protocol. You can't resolve 20kb near identical repeats/segdups with 10kb reads. All you can do is to bet your luck on a few excessively long reads spanning some units by chance. For divergent copies, it...
https://api.stackexchange.com
In one of my papers, I list some numerical results in addition to some figures. What I'd like to do is make sure that the numerical results in my paper always agree with the code. Right now, I just directly copy the numerical results from my simulation output into the paper, which is extremely simple and low-tech, but ...
What you are asking for is the Elsivier grand challenge of the "Executable Paper". While many approaches have been tried, none are as compelling as the authors might suggest. Here are a few examples of techniques used. Madagascar Project takes your approach, inside the make script have the simulations run that produc...
https://api.stackexchange.com
Here's Rosalind Franklin's famous Photo 51, the X-ray diffraction image of DNA from which Watson and Crick deduced its structure: My understanding is that it depicts a short segment of DNA shown from the side (so the axis that the strands wind around would run up and down through the center of the photo). Like this do...
Well, you said that you... ...have a lot of trouble connecting the photo to the diagram. And that's quite excusable: interpreting that X-ray image is actually very complicated . All the quotes and images in this answer, except the bulleted list further down, come from this paper (Lucas, 2008), which explains that hi...
https://api.stackexchange.com
When training a neural network, what difference does it make to set: batch size to $a$ and number of iterations to $b$ vs. batch size to $c$ and number of iterations to $d$ where $ ab = cd $? To put it otherwise, assuming that we train the neural network with the same amount of training examples, how to set the optim...
From Nitish Shirish Keskar, Dheevatsa Mudigere, Jorge Nocedal, Mikhail Smelyanskiy, Ping Tak Peter Tang. On Large-Batch Training for Deep Learning: Generalization Gap and Sharp Minima. : The stochastic gradient descent method and its variants are algorithms of choice for many Deep Learning tasks. These methods operat...
https://api.stackexchange.com
On the Wikipedia page about naive Bayes classifiers, there is this line: $p(\mathrm{height}|\mathrm{male}) = 1.5789$ (A probability distribution over 1 is OK. It is the area under the bell curve that is equal to 1.) How can a value $>1$ be OK? I thought all probability values were expressed in the range $0 \leq p \...
That Wiki page is abusing language by referring to this number as a probability. You are correct that it is not. It is actually a probability per foot. Specifically, the value of 1.5789 (for a height of 6 feet) implies that the probability of a height between, say, 5.99 and 6.01 feet is close to the following unitle...
https://api.stackexchange.com
This has come up repeatedly recently: I have a very large text file (in the order of several GiB) and I need to perform line-based subsetting for around 10,000 lines. There exist solutions for specific scenarios (e.g. samtools view -s for randomly sampling BAM files) but sometimes my use-case doesn’t fit into these cat...
Turns out, simply keeping track of the next candidate line (after sorting the sample line numbers) fixes the performance issue, and most of the remaining slowness seems to be due to the overhead of actually reading the file so there’s not very much to improve. Since I don’t know how how to do this in sed, and it’s not ...
https://api.stackexchange.com
I have a fasta file like >sample 1 gene 1 atgc >sample 1 gene 2 atgc >sample 2 gene 1 atgc I want to get the following output, with one break between the header and the sequence. >sample 1 gene 1 atgc >sample 1 gene 2 atgc >sample 2 gene 1 atgc
If you have multi-line fasta files, as is very common, you can use these scripts1 to convert between fasta and tbl (sequence_name <TAB> sequence) format: FastaToTbl #!/usr/bin/awk -f { if (substr($1,1,1)==">") if (NR>1) printf "\n%s\t", substr($0,2,length($0)-1) else pr...
https://api.stackexchange.com
I am using a reference genome for mm10 mouse downloaded from NCBI, and would like to understand in greater detail the difference between lowercase and uppercase letters, which make up roughly equal parts of the genome. I understand that N is used for 'hard masking' (areas in the genome that could not be assembled) and ...
What does this soft masking actually mean? A lot of the sequence in genomes are repetitive. Human genome, for example, has (at least) two-third repetitive elements.[1]. These repetitive elements are soft-masked by converting the upper case letters to lower case. An important use-case of these soft-masked bases will b...
https://api.stackexchange.com
Models of structures deposited in the Protein Data Bank vary in the quality, depending both on the data quality and expertise and patience of the person who built the model. Is there a well-accepted subset of the PDB entries that has only "high quality" structures? Ideally these structures would be representative for c...
There is a very nice database, pdbcull (also known as the PISCES server in the literature). It filters the PDB for high resolution and reduced sequence identity. It also seems to be updated regularly. Depending on the cut-offs, you get between 3000 and 35000 structures. If you are specifically interested in rotamers, y...
https://api.stackexchange.com
I guess I've been somewhat ignorant when it comes to the finer details of pcb layout. Lately I've read a couple of books that try their best to lead me on the straight and narrow. Here is a couple of examples of a recent board of mine, and I have highlighted three of the decoupling caps. The MCU is a LQFP100 package an...
Proper bypassing and grounding are unfortunately subjects that seem to be poorly taught and poorly understood. They are actually two separate issues. You are asking about the bypassing, but have also implicitly gotten into grounding. For most signal problems, and this case is no exception, it helps to consider them b...
https://api.stackexchange.com
The IGSR has a sample for encoding structural variants in the VCF 4.0 format. An example from the site (the first record): #CHROM POS ID REF ALT QUAL FILTER INFO FORMAT NA00001 1 2827693 . CCGTGGATGCGGGGACCCGCATCCCCTCTCCCTTCACAGCTGAGTGACCCACATCCCCTCTCCCCTCGCA C . PASS SVTYPE=DEL;END=2827680;BKPTID=Pindel_...
I just received a reply from 1000Genomes regarding this. I'll post it in its entirety below: Looking at the example you mention, I find it difficult to come up with an interpretation of the information whereby the stated end seems to be correct, so believe that this may indeed be an error. Since the v4.0 was creat...
https://api.stackexchange.com
If an observer starts moving at relativistic speeds will he observe the temperature of objects to change as compared to their rest temperatures? Suppose the rest temperature measured is $T$ and the observer starts moving with speed $v$. What will be the new temperature observed by him?
This is a very good question. Einstein himself, in a 1907 review (available in translation as Am. J. Phys. 45, 512 (1977), e.g. here), and Planck, one year later, assumed the first and second law of thermodynamics to be covariant, and derived from that the following transformation rule for the temperature: $$ T' = T/\g...
https://api.stackexchange.com
I've been checking life expectancy figures for men versus women in many countries of the world and the figures for men sometimes are terrifying. Countries like Russia have a 12 years gap in disfavor of men. Developed countries have usually a 4-5 years gap in disfavor of men. My country Argentina has a 7 years gap. Afri...
There are both biological and social factor for that: Biological Females have two X chromosomes. When mutations in genes of the X chromosome occur, females have a second X to compensate. Males, on the other hand gave just one chromosome X and all genes its genes express themselves, even those lethal or deleterious. F...
https://api.stackexchange.com
As far as I understand, both SURF and SIFT are patent protected. Are there any alternative methods that can be used in a commercial application freely? For more info on the patent check out:
Both SIFT and SURF authors require license fees for usage of their original algorithms. I have done some research about the situation and here are the possible alternatives: Keypoint detector: Harris corner detector Harris-Laplace - scale-invariant version of Harris detector (an affine invariant version also exists, p...
https://api.stackexchange.com
Is there a way, using some established Python package (e.g. SciPy) to define my own probability density function (without any prior data, just $f(x) = a x + b$), so I can then make calculations with it (such as obtaining the variance of the continuous random variable)? Of course I could take, say, SymPy or Sage, create...
You have to subclass the rv_continuous class in scipy.stats import scipy.stats as st class my_pdf(st.rv_continuous): def _pdf(self,x): return 3*x**2 # Normalized over its range, in this case [0,1] my_cv = my_pdf(a=0, b=1, name='my_pdf') now my_cv is a continuous random variable with the given PDF and ra...
https://api.stackexchange.com
I have a signal of some length, say 1000 samples. I would like to extend this signal to 5000 samples, sampled at the same rate as the original (i.e., I want to predict what the signal would be if I continued to sample it for a longer period of time). The signal is composed of several sinusoidal components added togethe...
I think linear predictive coding (otherwise known as an auto-regressive moving average) is what you are looking for. LPC extrapolates a time series by first fitting a linear model to the time series, in which each sample is assumed to be a linear combination of previous samples. After fitting this model to the existi...
https://api.stackexchange.com
What would be the ideal way to find the mean and standard deviation of a signal for a real time application. I'd like to be able to trigger a controller when a signal was more than 3 standard deviation off of the mean for a certain amount of time. I'm assuming a dedicated DSP would do this pretty readily, but is the...
There's a flaw in Jason R's answer, which is discussed in Knuth's "Art of Computer Programming" vol. 2. The problem comes if you have a standard deviation which is a small fraction of the mean: the calculation of E(x^2) - (E(x)^2) suffers from severe sensitivity to floating point rounding errors. You can even try this ...
https://api.stackexchange.com
I've been using Ruby to write scripts for research, but I want to get into some heavier stuff that Ruby is just too slow for. I noticed there are a few things written in C and C++, but there is an oddly large proportion of software used in computational chemistry that is written in FORTRAN (in which I have zero experie...
I don't think that's really true anymore. Some Fortran use is historical (i.e., early codes were developed in FORTRAN because that was the best programming language for number crunching in the 70s and 80s). Heck, the name stands for "formula translation." Some Fortran use is because of performance. The language was des...
https://api.stackexchange.com
Millions of colors in the visible spectrum can be generated by mixing red, green and blue - the RGB color system. Is there a basic set of smells that, when mixed, can yield all, or nearly all detectable smells ?
There are about 100 (Purves, 2001) to 400 (Zozulya et al., 2001) functional olfactory receptors in man. While the total tally of olfactory receptor genes exceeds 1000, more than half of them are inactive pseudogenes. The combined activity of the expressed functional receptors accounts for the number of distinct odors t...
https://api.stackexchange.com
I read the Wikipedia entry about "List of NP-complete problems" and found that games like super mario, pokemon, tetris or candy crush saga are np-complete. How can I imagine np-completeness of a game? Answers don't need to be too precise. I just want to get an overview what it means that games can be np-complete.
It just means that you can create levels or puzzles within these games that encode NP-Hard problems. You can take a graph coloring problem, create an associated Super Mario Bros. level, and that level is beatable if and only if the graph is 3-colorable. If you want to see the specific way the NP-Complete problems are t...
https://api.stackexchange.com
I have noticed that some applications or algorithms that are built on a programming language, say C++/Rust run faster or snappier than those built on say, Java/Node.js, running on the same machine. I have a few question regarding this: Why does this happen? What governs the "speed" of a programming language? Has this ...
In programming language design and implementation, there is a large number of choices that can affect performance. I'll only mention a few. Every language ultimately has to be run by executing machine code. A "compiled" language such as C++ is parsed, decoded, and translated to machine code only once, at compile-time. ...
https://api.stackexchange.com
Last year, I read a blog post from Brendan O'Connor entitled "Statistics vs. Machine Learning, fight!" that discussed some of the differences between the two fields. Andrew Gelman responded favorably to this: Simon Blomberg: From R's fortunes package: To paraphrase provocatively, 'machine learning is statistics minus...
I think the answer to your first question is simply in the affirmative. Take any issue of Statistical Science, JASA, Annals of Statistics of the past 10 years and you'll find papers on boosting, SVM, and neural networks, although this area is less active now. Statisticians have appropriated the work of Valiant and Vapn...
https://api.stackexchange.com
When you look at all the genome files available from Ensembl. You are presented with a bunch of options. Which one is the best to use/download? You have a combination of choices. First part options: dna_sm - Repeats soft-masked (converts repeat nucleotides to lowercase) dna_rm - Repeats masked (converts repeats to to ...
There's rarely a good reason to use a hard-masked genome (sometimes for blast, but that's it). For that reason, we use soft-masked genomes, which only have the benefit of showing roughly where repeats are (we never make use of this for our *-seq experiments, but it's there in case we ever want to). For primary vs. topl...
https://api.stackexchange.com
The following equation is standard in thermodynamics: $$ \Delta G^\circ=-RT\log(K) $$ where $K$ is the equilibrium constant. In dimensional analysis, Bridgman's theorem tells us that the argument of a transcendental function (like $\log$) must always be dimensionless. But $K$ may have dimensions (depending on the pa...
The problem is that people are often sloppy with the definition of quantities. The equilibrium constant $K$ in your first equation is indeed a dimensionless quantity while the equilibrium constant $K_c$ that is usually used to describe an equilibrium in a solution is not. I will take some detour to show where they come...
https://api.stackexchange.com
In this MO post, I ran into the following family of polynomials: $$f_n(x)=\sum_{m=0}^{n}\prod_{k=0}^{m-1}\frac{x^n-x^k}{x^m-x^k}.$$ In the context of the post, $x$ was a prime number, and $f_n(x)$ counted the number of subspaces of an $n$-dimensional vector space over $GF(x)$ (which I was using to determine the number ...
First, has anybody ever seen anything at all like this before? Yes, and in fact the interesting patterns that arise here are more than just a mathematical curiosity, they can be interpreted to have a physical context. Statistical Mechanics In a simple spin system, say the Ising model, a discrete set of points are arr...
https://api.stackexchange.com
One of my friends said that I would die if I drank distilled water (we were using it in a chemistry experiment) I gave it a go and surprisingly did not die. I did a bit of Googling and found this It said that drinking only this kind of water could definitely cause death, as distilled water was highly hypotonic and it ...
I'm extremely skeptical of @leonardo's answer. I suspect that what would happen if you drank only distilled water is nothing perceptible. The only place where concentrations of distilled water would ever be high enough to conceivably matter is in the tissues of the mouth and throat, and even there, the effect would b...
https://api.stackexchange.com
Artificial intelligence website defines off-policy and on-policy learning as follows: "An off-policy learner learns the value of the optimal policy independently of the agent's actions. Q-learning is an off-policy learner. An on-policy learner learns the value of the policy being carried out by the agent including th...
First of all, there's no reason that an agent has to do the greedy action; Agents can explore or they can follow options. This is not what separates on-policy from off-policy learning. The reason that Q-learning is off-policy is that it updates its Q-values using the Q-value of the next state $s'$ and the greedy act...
https://api.stackexchange.com
In the book Thomas's Calculus (11th edition) it is mentioned (Section 3.8 pg 225) that the derivative $\frac{\textrm{d}y}{\textrm{d}x}$ is not a ratio. Couldn't it be interpreted as a ratio, because according to the formula $\textrm{d}y = f'(x)\textrm{d}x$ we are able to plug in values for $\textrm{d}x$ and calculate a...
Historically, when Leibniz conceived of the notation, $\frac{dy}{dx}$ was supposed to be a quotient: it was the quotient of the "infinitesimal change in $y$ produced by the change in $x$" divided by the "infinitesimal change in $x$". However, the formulation of calculus with infinitesimals in the usual setting of the ...
https://api.stackexchange.com
Are there any advantages to use a window approach over Parks-McClellan (further abbreviated here as PMcC) or Least Squares algorithms for FIR filter design of a low pass filter? Assume with today's computational power that the complexity of the algorithms themselves is not a factor. This question is not comparing PMcC...
I agree that the windowing filter design method is not one of the most important design methods anymore, and it might indeed be the case that it is overrepresented in traditional textbooks, probably due to historical reasons. However, I think that its use can be justified in certain situations. I do not agree that comp...
https://api.stackexchange.com
We all have elaborative discussion in physics about classical mechanics as well as interaction of particles through forces and certain laws which all particles obey. I want to ask, does a particle exert a force on itself? EDIT– Thanks for the respectful answers and comments. I have edited this question in order to elab...
This is one of those terribly simple questions which is also astonishingly insightful and surprisingly a big deal in physics. I'd like to commend you for the question! The classical mechanics answer is "because we say it doesn't." One of the peculiarities about science is that it doesn't tell you the true answer, in ...
https://api.stackexchange.com
I know the general concept of recursion. I came across the concept of tail recursion while studying the quicksort algorithm. In this video of quick sort algorithm from MIT at 18:30 seconds the professor says that this is a tail recursive algorithm. It is not clear to me what tail recursion really means. Can someone ...
Tail recursion is a special case of recursion where the calling function does no more computation after making a recursive call. For example, the function int f(int x, int y) { if (y == 0) { return x; } return f(x*y, y-1); } is tail recursive (since the final instruction is a recursive call) whereas this ...
https://api.stackexchange.com
I have matrices $A$ and $G$. $A$ is sparse and is $n\times n$ with $n$ very large (can be on the order of several million.) $G$ is an $n\times m$ tall matrix with $m$ rather small ($1 \lt m \lt 1000$) and each column can only have a single $1$ entry with the rest being $0$'s, such that $G^TG = I$. $A$ is huge, so it is...
Introduce the vector $y:=-A^{-1}Gx$ and solve the large coupled system $Ay+Gx=0$, $G^Ty=-b$ for $(y,x)$ simultaneously, using an iterative method. If $A$ is symmetric (as seems likely though you don't state it explicitly) then the system is symmetric (but indefinite, though quasidefinite if $A$ is positive definite), w...
https://api.stackexchange.com
I was asked today in class why you divide the sum of square error by $n-1$ instead of with $n$, when calculating the standard deviation. I said I am not going to answer it in class (since I didn't wanna go into unbiased estimators), but later I wondered - is there an intuitive explanation for this?!
The standard deviation calculated with a divisor of $n-1$ is a standard deviation calculated from the sample as an estimate of the standard deviation of the population from which the sample was drawn. Because the observed values fall, on average, closer to the sample mean than to the population mean, the standard devia...
https://api.stackexchange.com
I need basic electronics books (diodes, transistors, current, etc.) as I am just starting out with electronics and want to have something to read over the holiday. Any suggestions of good beginners' books?
The Art of Electronics:Paul Horowitz and Winfield Hill Often described as the Bible of Electronics. Its fair to say that if you buy this one, you wont need another for a while! Contents: Foundations voltage and current; passive components; signals; complex analysis made simple. Transistors an easy-to-use transi...
https://api.stackexchange.com
In my exam, I was asked why cyclopropane could decolourise bromine water (indicating that it reacted with the bromine). All I could guess was that it is related to the high angle strain in cyclopropane, as the C–C–C bond angle is $60^\circ$ instead of the required $109.5^\circ$. No book I have read mentions this reacti...
The following ring opening reaction will occour: You are quite right about the angle strain. Because orbital interactions are not optimal in this geometry. Consider p-orbitals, then a natural bond angle would be $\theta\in [90^\circ; 180^\circ]$. A mixing of s- and p-type orbitals allows a wide range of angles $\thet...
https://api.stackexchange.com
There are three techniques used in CV that seem very similar to each other, but with subtle differences: Laplacian of Gaussian: $\nabla^2\left[g(x,y,t)\ast f(x,y)\right]$ Difference of Gaussians: $ \left[g_1(x,y,t)\ast f(x,y)\right] - \left[g_2(x,y,t)\ast f(x,y)\right]$ Convolution with Ricker wavelet: $\textrm{Ricker...
Laplace of Gaussian The Laplace of Gaussian (LoG) of image $f$ can be written as $$ \nabla^2 (f * g) = f * \nabla^2 g $$ with $g$ the Gaussian kernel and $*$ the convolution. That is, the Laplace of the image smoothed by a Gaussian kernel is identical to the image convolved with the Laplace of the Gaussian kernel. This...
https://api.stackexchange.com
According to the Physics Factbook, nerve impulses travel at speeds anywhere from 1 meter per second up to around 100 meters per second. Blue whales reach up to around 30 meters long. For a full-size blue whale, this means that a nerve impulse to move the tail muscles could take from 0.3 seconds to 30 seconds to reach t...
Yes, larger animals do experience larger delays in movement. There have been studies of size difference vs sensorimotor delays in terrestrial mammals, That graph is for innate reflexes of a needle to the hind versus a kick-time. Perhaps no one dared to prick a blue whale. Elephant vs shrew, heartbeat of 30 vs 1500 BP...
https://api.stackexchange.com
I have a sensor that reports its readings with a time stamp and a value. However, it does not generate readings at a fixed rate. I find the variable rate data difficult to deal with. Most filters expect a fixed sample rate. Drawing graphs is easier with a fixed sample rate as well. Is there an algorithm to resample fro...
The simplest approach is to do some kind of spline interpolation like Jim Clay suggests (linear or otherwise). However, if you have the luxury of batch processing, and especially if you have an overdetermined set of nonuniform samples, there's a "perfect reconstruction" algorithm that's extremely elegant. For numerical...
https://api.stackexchange.com
All humans can be grouped into ABO and Rh+/- blood groups (at a minimum). Is there any advantage at all to one group or the other? This article hints that there are some pathogens that display a preference to a blood type (for example Schistosomiasis apparently being more common in people with blood group A, although...
I've been doing a little more digging myself and have found a couple of other advantages: Risk of Venous-thromboembolism (deep vein thrombosis/pulmonary embolism (1)). Blood group O individuals are at lower risk of the above conditions due to reduced levels of von Willebrand factor(2) and factor VIII clotting factors....
https://api.stackexchange.com
My understanding is that $R^2$ cannot be negative as it is the square of R. However I ran a simple linear regression in SPSS with a single independent variable and a dependent variable. My SPSS output give me a negative value for $R^2$. If I was to calculate this by hand from R then $R^2$ would be positive. What has S...
$R^2$ compares the fit of the chosen model with that of a horizontal straight line (the null hypothesis). If the chosen model fits worse than a horizontal line, then $R^2$ is negative. Note that $R^2$ is not always the square of anything, so it can have a negative value without violating any rules of math. $R^2$ is neg...
https://api.stackexchange.com
Imagine a standard machine-learning scenario: You are confronted with a large multivariate dataset and you have a pretty blurry understanding of it. What you need to do is to make predictions about some variable based on what you have. As usual, you clean the data, look at descriptive statistics, run some models...
Forecastability You are right that this is a question of forecastability. There have been a few articles on forecastability in the IIF's practitioner-oriented journal Foresight. (Full disclosure: I'm an Associate Editor.) The problem is that forecastability is already hard to assess in "simple" cases. A few examples Su...
https://api.stackexchange.com
I've always wondered this: every single modern PCB is routed at 45 degree angle increments. Why does the industry prefer this so much? Doesn't any-angle routing offer more flexibility? One plausible theory would be that the existing tools only support 45 degree increments and that there isn't much pressure to move away...
Fundamentally, it basically boils down to the fact that the software is way easier to design with only 45° angles. Modern autorouters are getting better, but most of the PCB tools available have roots that go back to the DOS days, and therefore there is an enormous amount of legacy pressure to not completely redesign t...
https://api.stackexchange.com
What considerations should I be making when choosing between BFGS and conjugate gradient for optimization? The function I am trying to fit with these variables are exponential functions; however, the actual objective function involves integration, among other things, and is very costly if that helps at all.
The associated cost of BFGS may be brought more in line with CG if you use the limited memory variants rather than the full-storage BFGS. This computes the BFGS update for the last $m$ updates efficiently by a series of rank-one updates without needing to store more than the last $m$ solutions and gradients. In my exp...
https://api.stackexchange.com
Every once in a while, we get a question asking for a book or other educational reference on a particular topic at a particular level. This is a meta-question that collects all those links together. If you're looking for book recommendations, this is probably the place to start. All the questions linked below, as well ...
Broad Interest Please recommend a good book about physics for young child (elementary school aged) Books that develop interest & critical thinking among high school students Books that every layman should read Books that every physicist should read A good highschool level physics book Are there modern 1st year univers...
https://api.stackexchange.com
Let me start by apologizing if there is another thread on math.se that subsumes this. I was updating my answer to the question here during which I made the claim that "I spend a lot of time sifting through books to find [the best source]". It strikes me now that while I love books (I really do), I often find that I lea...
In no particular order: Algebraic number theory notes by Sharifi: Dalawat's first course in local arithmetic: Intro to top grps: Representation theory resources: Classical invariant theory: CRing project: - The notes are huge & has many authors - including MSE's Zev, Akhil (no longer active) & Darij. Check the T...
https://api.stackexchange.com
As a small introductory project, I want to compare genome sequences of different strains of influenza virus. What are the publicly available databases of influenza virus gene/genome sequences?
There area few different influenza virus database resources: The Influenza Research Database (IRD) (a.k.a FluDB - based upon URL) A NIAID Bioinformatics Resource Center or BRC which highly curates the data brought in and integrates it with numerous other relevant data types The NCBI Influenza Virus Resource A sub-...
https://api.stackexchange.com
For my own understanding, I am interested in manually replicating the calculation of the standard errors of estimated coefficients as, for example, come with the output of the lm() function in R, but haven't been able to pin it down. What is the formula / implementation used?
The linear model is written as $$ \left| \begin{array}{l} \mathbf{y} = \mathbf{X} \mathbf{\beta} + \mathbf{\epsilon} \\ \mathbf{\epsilon} \sim N(0, \sigma^2 \mathbf{I}), \end{array} \right.$$ where $\mathbf{y}$ denotes the vector of responses, $\mathbf{\beta}$ is the vector of fixed effects parameters, $\mathbf{X}$ is...
https://api.stackexchange.com
How do I download a reference genome that I can use with bowtie2? Specifically HG19. On UCSC there are a lot of file options.
It’s a matter of preference I guess but I recommend the Ensembl builds. Decide whether you want the toplevel or primary assembly, and whether you want soft-masked, repeat-masked or unmasked files. The naming schema is very straightforward; the combinations are described in the README file, and all files reside in one d...
https://api.stackexchange.com
In my AI textbook there is this paragraph, without any explanation. The sigmoid function is defined as follows $$\sigma (x) = \frac{1}{1+e^{-x}}.$$ This function is easy to differentiate because $$\frac{d\sigma (x)}{d(x)} = \sigma (x)\cdot (1-\sigma(x)).$$ It has been a long time since I've taken differential equatio...
Let's denote the sigmoid function as $\sigma(x) = \dfrac{1}{1 + e^{-x}}$. The derivative of the sigmoid is $\dfrac{d}{dx}\sigma(x) = \sigma(x)(1 - \sigma(x))$. Here's a detailed derivation: $$ \begin{align} \dfrac{d}{dx} \sigma(x) &= \dfrac{d}{dx} \left[ \dfrac{1}{1 + e^{-x}} \right] \\ &= \dfrac{d}{dx} \left( 1 + \mat...
https://api.stackexchange.com
There have been a few methods proposed for integration (or batch correction) of scRNA-seq datasets, such as Seurat CCA, MNN Correct, Scanorama, and Harmony. The concern is generally about the maximum number of cells that they handle, but I haven't seen any discussion about the minimum number of cells. I am confident th...
TLDR: Harmony can work on 106~ cell samples but has less versatility then methods like BATMAN. BATMAN is useful if you need your data for differential gene expression and single-cell eQTL and can work on ~200 cell data. Well their certainly is a minimum which comes down to several factors. As many of these rely on algo...
https://api.stackexchange.com
In differential geometry, there are several notions of differentiation, namely: Exterior Derivative, $d$ Covariant Derivative/Connection, $\nabla$ Lie Derivative, $\mathcal{L}$. I have listed them in order of appearance in my education/in descending order of my understanding of them. Note, there may be others that I ...
Short answer: the exterior derivative acts on differential forms; the Lie derivative acts on any tensors and some other geometric objects (they have to be natural, e.g. a connection, see the paper of P. Petersen below); both the exterior and the Lie derivatives don't require any additional geometric structure: they r...
https://api.stackexchange.com
ATLAS is a free BLAS/LAPACK replacement that tunes itself to the machine when compiled. MKL is the commercial library shipped by Intel. Are these two libraries comparable when it comes to performance, or does MKL have the upper hand for some tasks? If so, which ones?
MKL (from Intel) is optimized for Intel processors, and probably has the "upper hand" there in many cases. But it is also "famous" for choosing the "worst" code-paths for AMD processors, as described here.
https://api.stackexchange.com
I have much more experience programming than I do with advanced mathematics, so perhaps this is just a comfort thing with me, but I often get frustrated when I try to follow mathematical notation. Specifically, I get frustrated trying to keep track of what each variable signifies. As a programmer, this would be complet...
I think one reason is that often one does not want to remember what the variable names really represent. As an example, when we choose to talk about the matrix $(a_{ij})$ instead of the matrix $(\mathrm{TransitionProbability}_{ij})$, this expresses the important fact that once we have formulated our problem in terms o...
https://api.stackexchange.com
I am trying to understand the algorithms by Peterson and Dekker which are very similar and display a lot of symmetries. I tried to formulate the algorithms in informal language like follows: Peterson's: "I want to enter." flag[0]=true; "You can enter next." turn=1; "...
Your informal descriptions of the algorithms is wonderful. I think in both cases the author was trying to come up with the simplest solution they could think of that guaranteed both mutual exclusion and deadlock freedom. Neither algorithm is starvation free or fair.[ed: as pointed out in the comments, both algorithms ...
https://api.stackexchange.com
If you've ever been annoyingly poked by a geek, you might be familiar with the semi-nerdy obnoxious response of "I'm not actually touching you! The electrons in the atoms of my skin are just getting really close to yours!" Expanding on this a little bit, it seems the obnoxious geek is right. After all, consider Ze...
Wow, this one has been over-answered already, I know... but it is such a fun question! So, here's an answer that hasn't been, um, "touched" on yet... :) You, sir, whatever your age may be (anyone with kids will know what I mean), have asked for an answer to one of the deepest questions of quantum mechanics. In the quan...
https://api.stackexchange.com
I want some templates of different file formats that I can use to test my scripts and identify possible bugs in my code. For example, consider nucleotide FASTA, a simple but often abused format, I would want templates to capture regular and irregular formats, like I have seen all of these: 1) Single line sequence >1 AT...
You mention Biopython, which contains tests: Some of the tests consist in reading files present in the folders listed in the above link. These files could be a starting point for a database of test files. Whenever one comes across a test case not covered with these files, one could construct a new test file and contri...
https://api.stackexchange.com
Does anyone know what the MAPQ values produced by BWA-MEM mean? I'm looking for something similar to what Keith Bradnam discovered for Tophat v 1.4.1, where he realized that: 0 = maps to 5 or more locations 1 = maps to 3-4 locations 3 = maps to 2 locations 255 = unique mapping I'm familiar with the notion that ...
First of all, if you want to understand mapping quality (mapQ), ignore RNA-seq mappers. They often produce misleading mapQ because mapQ is not important to RNA-seq anyway. Strictly speaking, you have two questions, one in the title: the meaning of mapQ; and the other in a comment: how mapQ is computed. On the meaning, ...
https://api.stackexchange.com
edit: Results are current as of Dec 4, 2018 13:00 PST. Background K-mers have many uses in bioinformatics, and for this reason it would be useful to know the most RAM-efficient and fastest way to work with them programmatically. There have been questions covering what canonical k-mers are, how much RAM k-mer storage th...
The question and the accepted answer are not about k-mer data structure at all, which I will explain in detail below. I will first answer the actual question OP intends to ask. The simplest way to keep k-mers is to use an ordinary hash table. The performance is mostly determined by the hash table library. std::unordere...
https://api.stackexchange.com
My daughter is in year $3$ and she is now working on subtraction up to $1000.$ She came up with a way of solving her simple sums that we (her parents) and her teachers can't understand. Here is an example: $61-17$ Instead of borrowing, making it $50+11-17,$ and then doing what she was told in school $11-7=4,$ $50-10=40...
So she is doing \begin{align*} 61-17=(60+1)-(10+7)&=(60-10)-(7-1)\\ & = 50-6\\ & =44 \end{align*} She manage to have positive results on each power of ten group up to a multiplication by $\pm 1$ and sums at the end the pieces ; this is kind of smart :) Conclusion : If she is comfortable with this system, let her do.....
https://api.stackexchange.com
From school, I remember a very important rule: first you need to pour the water and then the acid (when you need to mix them) not vice-versa. This is because otherwise the aсid becomes very hot and splashing may happen. So, why does it get hotter when water is poured into it? What reaction takes place?
This is mostly the case for sulfuric acid. Commercially available sulfuric acid is dense (~1.8 g/ml) and when water is added, it may not mix. In this case a layer of hot weak acid solution is formed, which boils and sprays around. When acid is poured into water, it flows down the flask and mixes much better, so no boil...
https://api.stackexchange.com
The 2018 Nobel Prize in Physics was awarded recently, with half going to Arthur Ashkin for his work on optical tweezers and half going to Gérard Mourou and Donna Strickland for developing a technique called "Chirped Pulse Amplification". In general, optical tweezers are relatively well known, but Chirped Pulse Amplific...
The problem Lasers do all sorts of cool things in research and in applications, and there are many good reasons for it, including their coherence, frequency stability, and controllability, but for some applications, the thing that really matters is raw power. As a simple example, it had long been understood that if the...
https://api.stackexchange.com
I have a DNA sequence for which I would like to quickly find the reverse complement. Is there a quick way of doing this on the bash command line using only GNU tools?
Thanks to Manu Tamminen for this solution: echo ACCTTGAAA | tr ACGTacgt TGCAtgca | rev
https://api.stackexchange.com
I am writing a python script that requires a reverse complement function to be called on DNA strings of length 1 through around length 30. Line profiling programs indicate that my functions spend a lot of time getting the reverse complements, so I am looking to optimize. What is the fastest way to get the reverse compl...
I don't know if it's the fastest, but the following provides an approximately 10x speed up over your functions: import string tab = string.maketrans("ACTG", "TGAC") def reverse_complement_table(seq): return seq.translate(tab)[::-1] The thing with hashing is that it adds a good bit of overhead for a replacement se...
https://api.stackexchange.com
Below is a signal which represents a recording of someone talking. I would like to create a series of smaller audio signals based on this. The idea being to detect when 'important' sound starts and ends and use those for markers to make new snippet of audio. In other words, I would like to use the silence as indicators...
What you really want to do is essentially called as Voice Activity Detection or speech detection. Basically any pure speech signal (which contains no music) has three parts. The voiced sound - which is basically caused by Vowels The unvoiced sound - which contains consonants. The characteristic of human sound is ...
https://api.stackexchange.com