Skip to content

Commit

Permalink
Merge pull request #133 from SanojPunchihewa/bug-fixes
Browse files Browse the repository at this point in the history
Bug fixes
  • Loading branch information
SanojPunchihewa committed Mar 5, 2020
2 parents 0f1f344 + 8023a89 commit b478b9b
Show file tree
Hide file tree
Showing 7 changed files with 106 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ private static ArrayList<Argument> configureArguments(Context context, PipelineS
case F5C_EVENT_ALIGNMENT:
rawFile = R.raw.f5c_event_align_arguments;
break;
case F5C_METH_FREQ:
rawFile = R.raw.f5c_meth_freq_arguments;
break;
default:
Log.e(TAG, "Invalid Pipeline Step");
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.Chronometer;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.ProgressBar;
Expand Down Expand Up @@ -61,6 +62,8 @@ public class ConfirmationActivity extends AppCompatActivity {

Button btnWriteLog;

Chronometer txtTimer;

Button btnProceed;

Button btnSendResults;
Expand Down Expand Up @@ -119,11 +122,34 @@ protected void onCreate(@Nullable final Bundle savedInstanceState) {
folderPath = getIntent().getExtras().getString("FOLDER_PATH");
}

LinearLayout.LayoutParams layoutParams1 =
new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT);
LinearLayout horizontalLayout = new LinearLayout(this);
horizontalLayout.setOrientation(LinearLayout.HORIZONTAL);

btnProceed = new Button(this);
layoutParams1.weight = 1f;
btnProceed.setLayoutParams(layoutParams1);
horizontalLayout.addView(btnProceed);

LinearLayout.LayoutParams layoutParams2 =
new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT);

txtTimer = new Chronometer(this);
txtTimer.setPadding(20, 0, 0, 0);
layoutParams2.weight = 4f;
txtTimer.setLayoutParams(layoutParams2);
horizontalLayout.addView(txtTimer);

linearLayout.addView(horizontalLayout);

btnProceed.setText("Run the Pipeline");
btnProceed.setOnClickListener(new OnClickListener() {
@Override
public void onClick(final View v) {
txtTimer.start();
btnProceed.setEnabled(false);
mProgressBar.setVisibility(View.VISIBLE);
GUIConfiguration.createPipeline();
Expand Down Expand Up @@ -173,7 +199,6 @@ public void run() {
new RunPipeline().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
});
linearLayout.addView(btnProceed);

mProgressBar = new ProgressBar(this,
null,
Expand Down Expand Up @@ -272,6 +297,7 @@ protected void onProgressUpdate(final Integer... values) {
@Override
protected void onPostExecute(final String s) {
super.onPostExecute(s);
txtTimer.stop();
GUIConfiguration.setPipelineState(PipelineState.COMPLETED);
NativeCommands.getNativeInstance().finishPipeline(logPipePath);
List<PipelineComponent> pipelineComponents = GUIConfiguration.getPipeline();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import android.net.Uri;
import android.os.Bundle;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
Expand Down Expand Up @@ -67,6 +68,17 @@ public void onClick(final View v) {
});
linearLayout.addView(btnTutorial);

TextView txtToolVersions = new TextView(this);
txtToolVersions.setMovementMethod(LinkMovementMethod.getInstance());
txtToolVersions.setText(
Html.fromHtml("<b>Tool versions used in this app</b><br>" +
"- Minimap2 v2.17-r974-dirty, commit <a href=\"https://github.com/lh3/minimap2/compare/d2de282...master\">d2de282</a><br><br>"
+
"- Samtools v1.10, commit <a href=\"https://github.com/samtools/samtools/compare/5ca6ee2...develop\">5ca6ee2</a><br><br>"
+
"- F5C v0.3-beta, commit <a href=\"https://github.com/hasindu2008/f5c/compare/cea05f7...master\">cea05f7</a>"));
linearLayout.addView(txtToolVersions);

TextView txtContribute = new TextView(this);
txtContribute.setText(
"\nPlease contribute to our work by testing,debugging, developing and submitting issues on our product\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ public enum PipelineStep {
SAMTOOL_INDEX(2, "samtool index"),
F5C_INDEX(3, "f5c index"),
F5C_CALL_METHYLATION(4, "f5c call-methylation"),
F5C_EVENT_ALIGNMENT(5, "f5c eventalign");
F5C_EVENT_ALIGNMENT(5, "f5c eventalign"),
F5C_METH_FREQ(6, "f5c meth-freq");

private final int value;

Expand Down
Binary file modified app/src/main/jniLibs/armeabi-v7a/libminimapshared.so
Binary file not shown.
11 changes: 10 additions & 1 deletion app/src/main/res/layout/activity_minit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,20 @@
android:orientation="vertical" />
</ScrollView>

<TextView
android:id="@+id/txt_uder_dev"
android:text="This option is under development"
android:layout_alignParentBottom="true"
android:gravity="center_horizontal"
android:padding="5dp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

<Button
android:id="@+id/btn_process_job"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_above="@id/txt_uder_dev"
android:layout_centerHorizontal="true"
android:layout_marginBottom="10dp"
android:visibility="gone"
Expand Down
52 changes: 52 additions & 0 deletions app/src/main/res/raw/f5c_meth_freq_arguments.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"args": [
{
"argName": "Input meth file",
"argValue": null,
"argDescription": "Call methylation file",
"flag": "-i",
"argID": "F5C_METH_FREQ_INPUT_FILE",
"isDependentOn": "F5C_METH_OUTPUT_FILE",
"hasFlag": true,
"flagOnly": false,
"required": true,
"isFile": true
},
{
"argName": "meth freq file",
"argValue": null,
"argDescription": "Methylation frequency file",
"flag": "-o",
"argID": "F5C_METH_FREQ_FILE",
"isDependentOn": "argIDofanotherArg",
"hasFlag": true,
"flagOnly": false,
"required": true,
"isFile": true
},
{
"argName": "Call threshold",
"argValue": "2.5",
"argDescription": "Call threshold [2.5]",
"flag": "-c",
"argID": "tobedecided",
"isDependentOn": "argIDofanotherArg",
"hasFlag": true,
"flagOnly": false,
"required": false,
"isFile": false
},
{
"argName": "Split groups",
"argValue": null,
"argDescription": "Split groups",
"flag": "-s",
"argID": "tobedecided",
"isDependentOn": "argIDofanotherArg",
"hasFlag": true,
"flagOnly": true,
"required": false,
"isFile": false
}
]
}

0 comments on commit b478b9b

Please sign in to comment.