Skip to content

Commit

Permalink
Merge pull request #125 from SanojPunchihewa/bug-fixes
Browse files Browse the repository at this point in the history
Bug fixes
  • Loading branch information
SanojPunchihewa authored Feb 16, 2020
2 parents 5db20d3 + 5afe035 commit 87d81f5
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,11 @@ private static void configureDemoArgsFilePath(Argument argument, String folder)
if (argument.getArgID().equals("SAMTOOL_SORT_OUTPUT_FILE")) {
argument.setArgValue(folder + "/reads.sorted.bam");
}
// For the Demo we need to use 100M max memory for samtools sort
if (argument.getArgID().equals("SAMTOOL_MAX_MEMORY")) {
argument.setSetByUser(true);
argument.setArgValue("100M");
}

if (argument.getArgID().equals("SAMTOOL_INDEX_INPUT_FILE")) {
argument.setArgValue(folder + "/reads.sorted.bam");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,13 @@ public void run() {
separator2.setBackgroundColor(Color.parseColor("#000000"));
linearLayout.addView(separator2);

if (GUIConfiguration.getAppMode() == AppMode.STANDALONE) {
TextView txtOuputFolderInfo = new TextView(this);
txtOuputFolderInfo.setText(
"By default, output files are written to the mobile-genomics folder in your main storage. If you have updated the output paths please check the respective folders");
linearLayout.addView(txtOuputFolderInfo);
}

mp = MediaPlayer.create(this, R.raw.alarm);

btnWriteLog = new Button(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Environment;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
Expand Down Expand Up @@ -66,12 +67,16 @@ public class StepActivity extends AppCompatActivity {

private List<String> fileNames;

private String MOBILE_GENOMICS_FOLDER_PATH;

@SuppressLint("ClickableViewAccessibility")
@Override
protected void onCreate(@Nullable final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layout_step);

MOBILE_GENOMICS_FOLDER_PATH = Environment.getExternalStorageDirectory() + "/" + "mobile-genomics/";

fileNames = new ArrayList<>();

adapter = new ArrayAdapter<>(this,
Expand Down Expand Up @@ -220,19 +225,23 @@ public void onItemClick(final AdapterView<?> parent, final View view, final int
editText.setText(folderPath + "/" + parent.getAdapter().getItem(position));
}
});
} else {
editText = new EditText(this);
}
editText.setId(argument_id + 1000);
if (argument.isFile()) {
if (argument.getIsDependentOn() != null) {
editText.setText(GUIConfiguration.getLinkedFileArgument(argument.getIsDependentOn()));
} else if (argument.getArgValue() != null) {
editText.setText(argument.getArgValue());
}
if (argument.getArgID().contains("OUTPUT") || argument.getArgID().contains("TEMP")) {
if (editText.getText() != null && !TextUtils.isEmpty(editText.getText().toString())) {
editText.setText(MOBILE_GENOMICS_FOLDER_PATH + editText.getText().toString());
} else {
editText.setText(MOBILE_GENOMICS_FOLDER_PATH);
}
}
} else {
editText = new EditText(this);
editText.setText(argument.getArgValue());
}
editText.setId(argument_id + 1000);
linearLayout.addView(editText);
LinearLayout.LayoutParams editText_LayoutParams =
new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT,
Expand Down Expand Up @@ -260,6 +269,10 @@ public void onClick(final View v) {
if (!argument.isFlagOnly()) {
EditText editText = findViewById(arg_id + 1000);
if (editText.getText() != null && !TextUtils.isEmpty(editText.getText().toString())) {
if (argument.isFile() && editText.getText().toString().endsWith("/")) {
haveSetAllRequiredArgs = false;
editText.setError("Please specify a file name");
}
String argValue = editText.getText().toString();
if (argument.isFile()) {
GUIConfiguration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ private void replaceDirectoryPath(String path) {
private void showCrashError() {
new AlertDialog.Builder(this)
.setTitle("F5N Crashed")
.setMessage("App Crashed due to Out Of Memory")
.setMessage(
"One of the Native libraries has encountered a problem, most probably an Out Of Memory. Refer tmp.log in main storage/mobile-genomics folder for more information")
.setPositiveButton("Go to Start page", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
Expand Down
Binary file modified app/src/main/jniLibs/arm64-v8a/libf5cshared.so
Binary file not shown.
Binary file modified app/src/main/jniLibs/armeabi-v7a/libf5cshared.so
Binary file not shown.
2 changes: 1 addition & 1 deletion app/src/main/res/raw/f5c_event_align_arguments.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"argName": "event summary file",
"argValue": "event.summary.txt",
"argDescription": "path to event summary file",
"flag": "--event-summary=",
"flag": "--summary",
"argID": "F5C_ALIGN_SUMMARY_OUTPUT_FILE",
"isDependentOn": null,
"hasFlag": true,
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/raw/samtool_sort_arguments.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"argValue": "768M",
"argDescription": "max memory per thread; suffix K/M/G recognized",
"flag": "-m",
"argID": "tobedecided",
"argID": "SAMTOOL_MAX_MEMORY",
"isDependentOn": "argIDofanotherArg",
"hasFlag": true,
"flagOnly": false,
Expand Down

0 comments on commit 87d81f5

Please sign in to comment.