This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SAM to VCF/BCF: | |
samtools view -Sb file.sam > file.bam | |
samtools mpileup -E -uf reference.fa file.bam > file.mpileup | |
bcftools view -cg file.mpileup > file.vcf | |
bcftools view -bcg file.mpileup > file.bcf | |
Using tabix and bgzip: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Make a custom Gson instance, with a custom TypeAdapter for each wrapper object. | |
// In this instance we only have RealmList<RealmInt> as a a wrapper for RealmList<Integer> | |
Type token = new TypeToken<RealmList<RealmInt>>(){}.getType(); | |
Gson gson = new GsonBuilder() | |
.setExclusionStrategies(new ExclusionStrategy() { | |
@Override | |
public boolean shouldSkipField(FieldAttributes f) { | |
return f.getDeclaringClass().equals(RealmObject.class); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Start Download | |
*/ | |
public void startDownload(String link, String filename) { | |
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).mkdirs(); | |
DownloadManager mManager = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE); | |
DownloadManager.Request mRqRequest = new DownloadManager.Request(Uri.parse(link)); | |
mRqRequest.setDescription("Download file..."); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String url = " ... "; // some real url from where you want to download | |
DownloadManager dm = (DownloadManager) getContext().getSystemService(Context.DOWNLOAD_SERVICE); | |
DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url)); | |
dm.enqueue(request); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Java Hello World | |
public class HelloWorldExample | |
{ | |
public static void main(String[] args) | |
{ | |
System.out.println("Hello World!"); | |
} | |
} | |
## Python Hello World |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//get phone number | |
TelephonyManager tm = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE); | |
String imei = tm.getDeviceId(); | |
String tel = tm.getLine1Number(); | |
<uses-permission android:name="android.permission.READ_PHONE_STATE"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Button button = (Button) findViewById(R.id.button); | |
Toolbar toolbar = (Toolbar) findViewById(R.id.myToolbar); | |
final WebView webView = (WebView) findViewById(R.id.webView); | |
//Set links to show in webview not open in another program. | |
webView.setWebViewClient(new WebViewClient()); | |
webView.getSettings().setJavaScriptEnabled(true); | |
String url = "http://www.alexhedley.com/form.asp"; | |
webView.loadUrl(url); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package amigosecreto.hp.example.com.db; | |
/** | |
* Created by HP on 17/06/2015. | |
*/ | |
import android.content.Context; | |
import android.database.sqlite.SQLiteDatabase; | |
import android.database.sqlite.SQLiteOpenHelper; | |
import android.util.Log; |